Home » C Programming » Basic Syntax » Question
  1. 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;
    }
    1. 0
    2. 1
    3. Error
    4. 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.



Your comments will be displayed only after manual approval.