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
What is structure and union in c?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
What is void main ()?
What is the difference between procedural and declarative language?
What is getche() function?
Why is not a pointer null after calling free?
What is malloc return c?
How do I read the arrow keys? What about function keys?
What is the difference between procedural and functional programming?
How can I direct output to the printer?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
Why is structure padding done in c?
How can I get back to the interactive keyboard if stdin is redirected?
What are 3 types of structures?
What is the difference between c &c++?