What will be the output of the following C code?
#include <stdio.h>
union p
{
int x;
float y;
};
int main()
{
union p p, b;
p.x = 10;
printf("%f\n", p.y);
}
#include <stdio.h>
union p
{
int x;
float y;
};
int main()
{
union p p, b;
p.x = 10;
printf("%f\n", p.y);
}A. Compile time error
B. Implementation dependent
C. 10.000000
D. 0.000000
Answer: Option B
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