what is y value of the code if input x=10
y=5;
if (x==10)
else if(x==9)
elae y=8;
a.9
b.8
c.6
d.7

Answer Posted / vint

int main()
{
int x = 10, y = 5;
if(x==10)
else if(x==9)
else y=8;
printf("%d",y);
return 0;
}
error: expected expression before 'else'

------------
int main()
{
int x = 10, y = 5;
if(x==10) {}
else if(x==9) {}
else {y=8;}
printf("%d",y);
return 0;
}

OP: 5

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you return multiple values from a function?

622


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

14941


What is the size of structure pointer in c?

603


How many header files are in c?

543


What are the 4 types of organizational structures?

613






What is console in c language?

599


What is printf () in c?

574


What is the benefit of using const for declaring constants?

579


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

638


What is return type in c?

633


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

590


What are run-time errors?

592


What is const and volatile in c?

559


Is main is a keyword in c?

598


What is the difference between exit() and _exit() function?

594