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 |
will the program compile? int i; scanf(ā%dā,i); printf(ā%dā,i);
what is Structural oriented language? give some example of this language.....?
What is a ternary operator in c?
Write a program in C to convert date displayed in gregorian to julian date
main() { int i; printf("%d", &i)+1; scanf("%d", i)-1; }
What is derived datatype in c?
what is C?
Explain what are preprocessor directives?
Explain what are multidimensional arrays?
#‎include‬<stdio.h> void main() { int i; for(i=5;0;i++) { printf("%d",i); } }
I didn't count the ducks that I saw in line, but I do remember that one duck was in front of two ducks, another duck behind two ducks. How many ducks did I see?
What is the difference between char a[] = "string"; and char *p = "string"; ?
14 Answers Adobe, Honeywell, TCS,