Find the output of the following program.
#includevoid main(){ int y=10; if(y++>9 && y++!=10 && y++>11) printf("%d", y); else printf("%d", y);}

Find the output of the following program.

#include<stdio.h>void main(){ int y=10; if(y++>9 && y++!=10 && y++>11) printf("%d", y); else printf("%d", y);}
Correct Answer 13

All the three condition in if is true.
if(y++>9 && y++!=10 && y++>11) such as
1st condition : 10++ > 9 is true and value of y is increase by 1 i.e y =11
2nd condition : 11++ != 10 is also ture and value of y is increase by 1 i.e y =12
3rd condition : 12++ > 11 is also ture and value of y is increase by 1 i.e y =13
Therefore if is excuted and print the value of y = 13

Related Questions

Comment on the following 2 C programs.
#include  //Program 1int main(){ int a; int b; int c;}#include  //Program 2int main(){ int a; { int b; } { int c; }}