adplus-dvertising
frame-decoration

Question

What is the output of this program?
#include <stdio.h>
int main()
{
    union demo {
        int x;
        int y;
    };
 
    union demo a = 100;
    printf("%d %d",a.x,a.y);
}

a.

100 0

b.

100 100

c.

0 0

d.

Compilation Error

Answer: (d).Compilation Error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?