Home » C Programming » Operators » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int p = 2;
    short int k = 3;
    float var = 4;
    if (sizeof((p == 3) ? var : k) == sizeof(float))
    {
    printf("Float\n");
    }
    else if (sizeof((p == 3) ? var : k) == sizeof(short int))
    {
    printf("Short int\n");
    }
    }
    1. Compilation Error
    2. Runtime Error
    3. Float
    4. Short int
    5. None of these
Correct Option: C

Float



Your comments will be displayed only after manual approval.