Last Updated : 28 Feb, 2019

What will be the output of the following program?

#include <stdio.h> 

union test1 
{ 
    int x; 
    int y; 
} Test1;
 
union test2 
{ 
    int x; 
    char y; 
} Test2; 

union test3 
{ 
    int arr[10]; 
    char y; 
} Test3; 

int main() 
{ 
    printf(\"%lu %lu %lu\", sizeof(Test1), 
    sizeof(Test2), sizeof(Test3)); 

    return 0; 
} 

(A) 8 2 42

(B) 8 1 41

(C) 4 4 40

(D) Error

(E) None of these


Answer: (C)

Explanation:

Quiz of this Question


Share your thoughts in the comments