What is the output of the below program?
#include <stdio.h> void main() { int var1 = 11, var2 = 22, var3 = 33; if (var3 > var2 > var1) { printf("input sequencing is correct"); } else { printf("input sequencing is not correct"); } }
--------------------------------------------------
The above program checks the following:
1. Conditional statement
2. Operators sequencing
2. Operators sequencing
--------------------------------------------------
In the p"if" condition, the condition checking starts from left,
first var3 > var2 is checked and it is true, meant 1
that means for the next condition is 1 > var1, which is false
so, it goes to the else condition.
The output is "input sequencing is not correct"
0 Comments