Question 6
What is the output of the following code?
#include <stdio.h>
int main(void) {
int a = 1, b = 2, c = 3;
int res = a < b < c;
printf("%d", res);
return 0;
}Detailed Solution
Relational operators associate left-to-right. (a < b) evaluates to 1 (true). Then (1 < c) evaluates to (1 < 3), which is 1.