What will be the output of the following C code?
#include <stdio.h>
union temp
{
char a;
char b;
int c;
}t;
int main()
{
printf("%d", sizeof(t));
return 0;
}
#include <stdio.h>
union temp
{
char a;
char b;
int c;
}t;
int main()
{
printf("%d", sizeof(t));
return 0;
}
A. 1
B. 2
C. 4
D. 6
Answer: Option C
Related Questions on Operators and Expressions
What does the ++ operator do in C when applied to a variable?
A. Decrements by 1
B. Adds 1
C. Doubles the value
D. Leaves it unchanged
Join The Discussion