Vidyalelo
C Programming · Q111

Structure and Union

Programming · C Programming · question 111

Q111

What will be the output of the following C code? #include union p int x; char y; ; int main() union p p, b; p.y = 60; b.x = 12; printf("%d ", p.y);

A.
Compile time error
B.
Depends on the compiler
C.
60
Answer
D.
Undefined behaviour

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board