Examveda
Examveda

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int a = 2;
    int b = 0;
    int y = (b == 0) ? a :(a > b) ? (b = 1): a;
    printf("%d\n", y);
}

A. Compile time error

B. 1

C. 2

D. Undefined behaviour

Answer: Option C


This Question Belongs to C Program >> C Fundamentals

Join The Discussion

Related Questions on C Fundamentals