What will be the output of the following code snippet? int main() {
What will be the output of the following code snippet?
#include<stdio.h>
int main() {
int a = 5, b = 3, c = 0;
if (a > b > c) {
printf("True\n");
} else {
printf("False\n");
}
return 0;
}
Show answerHide answer
Correct answer: (C) TRUE
Explanation
Relational operators are evaluated left to right: (5 > 3) gives 1, then 1 > 0 gives 1 (true), so "True" is printed.