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
Answers were Sorted based on User's Feedback
Answer / varun
the value of y is not changing so i think y wll reamin 5.
| Is This Answer Correct ? | 18 Yes | 1 No |
Answer / prakash
I'm getting "error C2181: illegal else without matching if".
If that is corrected then the output will be y = 5.
| Is This Answer Correct ? | 5 Yes | 0 No |
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 |
what is a c-language.what is do.
How many main () function we can have in a project?
why return type of main is not necessary in linux
The C language terminator is a.semicolon b.colon c.period d.exclamation mark
write a C program to print the program itself ?!
How can I ensure that integer arithmetic doesnt overflow?
Why does not use getgh(); and <conio.h> in c language.
Which built-in library function can be used to match a patter from the string?
Why is %d used in c?
What is the difference between fread buffer() and fwrite buffer()?
Using which language Test cases are added in .ptu file of RTRT unit testing???
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..