Basic Syntax


  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. View Hint View Answer Discuss in Forum

    a < b turns out to be true it is replaced by 1.

    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.