What will be the output of the following C code (Assuming size of int and float is 4)?
#include <stdio.h>
union
{
int ival;
float fval;
} u;
void main()
{
printf("%d", sizeof(u));
}
#include <stdio.h>
union
{
int ival;
float fval;
} u;
void main()
{
printf("%d", sizeof(u));
}A. 16
B. 8
C. 4
D. 32
Answer: Option C
Related Questions on Structure and Union
Which of the following can be a member of a structure?
A. Function
B. Another structure
C. Enumeration
D. All of the above

Join The Discussion