-
Which of the following is the correct output for the program given below?
#include <studio.h>
int main ()
{
int a = 40, b = 50, c = 10, x;
x = a < b < c;
printf("%d\n", x);
return 0;
}
-
- 0
- 1
- Error
- None of the above
Correct Option: B
Since a < b turns out to be true it is replaced by 1. This 1 is then compared with 10. Since this condition also turns out to be true it is replaced by 1. This 1 is then assigned to x.