What will be the output of the following C code?
#include <stdio.h>
union p
{
int x;
char y;
}k = {.y = 97};
int main()
{
printf("%d\n", k.y);
}
#include <stdio.h>
union p
{
int x;
char y;
}k = {.y = 97};
int main()
{
printf("%d\n", k.y);
}A. Compile time error
B. 97
C. a
D. Depends on the standard
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