Structure & Union Questions and Answers
Practice ModeShowing 10 of 95 questions
Q71
Find the output
union india
{
int i;
char ch[2];
}
orissa;
void main ( )
{
orissa.ch[0]=1;
orissa.ch[1]=2;
printf("%d", orissa.i);
}
Answer: Option A
Q72
Find the output
union abc
{
int x;
char c;
struct str
{
int a;
char b;
char c;
}p;
}q;
void main ( )
{
printf('%d", sizeof(q));
}
Answer: Option B
Q73
Find the output
union xxx
{
int x;
float y;
}xx;
void func(union xxx x);
void main ( )
{
xx.x=10;
xx.y=3.14;
func(xx);
printf("%d", xx.x);
}
void func (union xxx xx
{
xx.x=20;
printf("%d", xx.x);
return;
}
Answer: Option B
Q74
Find the output
union sbi
{
int i;
char ch[2];
};
void main ( )
{
union sbi idco={127};
printf('%d %d%d", idco.i,
idco.ch[0], idco.ch[1]);
}
Answer: Option A
Q75
Find the output.
union uni
{
int x;
char y;
};
void main ( )
{
union uni u;
u.x =90;
printf("%c", u.y);
}
Answer: Option B
Q76
Find the output
union res
{
char a:6;
int b:8;
};
void main ( )
{
union res s;
pintf("%d", sizeof (s));
}
Answer: Option D
Q77
Find the output.
union res
{
int a:16;
char b:10;
};
void main ( )
{
union res s;
s.b='B';
s.a=10;
printf('%c%d", s.b, s.a);
}
Answer: Option D
Q78
Find the output
union uni
int x;
int a:8;
char b:8;
};
void main ( )
{
union uni u={48};
printf('%d %d", u.a, u.b);
}
Answer: Option B
Q79
Find out the true statement.
Answer: Option D
Q80
Which member of a union is in use at any time can be known explicitly using
Answer: Option D