Home » C Programming » Unions » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    union
    {
    int n;
    char ch;
    }U;
    int main()
    {
    U.ch = 201;
    printf("%d\n", sizeof(U));
    }
    1. sizeof(int) + sizeof(char)
    2. sizeof(char)
    3. Compilation Error
    4. Depends on the compiler
    5. None of these
Correct Option: B

sizeof(char)



Your comments will be displayed only after manual approval.