Consider the following declarations:
union id
{
char color;
int size;
};
struct{
char country;
int date;
union id id;
}flag;
To assign a color to a flag, the correct statement would be
union id
{
char color;
int size;
};
struct{
char country;
int date;
union id id;
}flag;A. flag.color = 'W';
B. flag.id.color = 'W';
C. flag.color = 'WHITE';
D. flag.id.color = 'WHITE';
E. color.flag = 'W';
Answer: Option A
Solution (By Examveda Team)
2
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