Structure & Union Questions and Answers
Practice ModeShowing 10 of 95 questions
Q61
Find the output
union xxx
{
int x;
float y;
char z;
};
void main ( )
{
union xxx abc;
abc.x=10;
abc.y=3.14;
printf("%d", abc.x);
Answer: Option C
Q62
Find the output
union abc
{
int a;
long b;
};
void main ( )
{
union abc x;
x. b=10;
printf("%1d %d", x.b);
}
Answer: Option A
Q63
Which of the following is flse regarding bit fields?
Answer: Option C
Q64
Which of the following is best suited for memory optimization
Answer: Option A
Q65
Very first member of union is known as
Answer: Option D
Q66
Union is
Answer: Option A
Q67
Find the output
union xyz
float f;
int i;
} xx=5.0;
void main ( )
{
printf ('%f %d", xx.f, xx.i);
}
Answer: Option D
Q68
Which of the following statements true regarding UNION ?
I. Self-referential structure may be used as member of union.
II. Niested union is also possible.
III. ONe member of a union active at a time.
IV. Only active member can be initialized.
Answer: Option D
Q69
Find the output
union usa
{
unsigned int x[2];
char ch[4];
}
canada;
void main ( )
{
strcpy (canada.ch, "xyz"));
printf('%s%d", canada. ch, canada.x[1]);
}
Answer: Option D
Q70
The main advantage of union over structure is
Answer: Option C