Vidyalelo
C++ Programming · Q24

Structures and Unions in C++

Programming · C++ Programming · question 24

Q24

What is the output of the following code: union Number int x; float y; ; Number n; n.x = 10; cout << n.y; in C++?

A.
Compilation error
B.
10
C.
Garbage value
Answer
D.
0

Answer: Option C

Solution

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