What will be the output of the following C code? (Assuming size of char = 1, int = 4, double = 8)
#include <stdio.h>
union utemp
{
int a;
double b;
char c;
}u;
int main()
{
u.c = 'A';
u.a = 1;
printf("%d", sizeof(u));
}
#include <stdio.h>
union utemp
{
int a;
double b;
char c;
}u;
int main()
{
u.c = 'A';
u.a = 1;
printf("%d", sizeof(u));
}A. 1
B. 4
C. 8
D. 13
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