What will be the output of the following C code? [code] #include <stdio.h> int main() { int x = 1; short int

Tâm Tây

New member
What will be the output of the following C code?
Code:
    #include <stdio.h>
    int main()
    {
        int x = 1;
        short int i = 2;
        float f = 3;
        if (sizeof((x == 2) ? f : i) == sizeof(float))
            printf("float\n");
        else if (sizeof((x == 2) ? f : i) == sizeof(short int))
            printf("short int\n");
    }
A. float
B. short int
C. Undefined behaviour
D. Compile time error
 

Tìm kiếm

Back
Top