Structure & Union Questions and Answers
Practice ModeShowing 10 of 95 questions
Q51
A union can be a member of
Answer: Option A
Q52
Find the correct output
void main ( )
{
struct emp
{
int eid;
char ename[20];
};
struct emp e={010, "Deepak"};
show (e);
}
show (struct {int eid; char ename [20];}e)
{
printf("%0%s", e.eid,e.ename);
}
Answer: Option B
Q53
The minimum and maximum range of Bit field is
Answer: Option B
Q54
Find the output
void main ( )
{
struct abc
{
char ch[10];
int i;
};
struct abc a=
{"Dear", 10, "Customer", 20};
printf('%s", a.ch);
}
Answer: Option C
Q55
In the following program p.a. is same as:
struct xxx
{
int a;
int b;
}b={9, 10};
Answer: Option C
Q56
Find the output
void main ( )
{
struct yyy
{
char ch;
int i;
};
struct yyy y={'1', 1};
xxx (y);
}
xxx (struct yyy y)
{
printf ("%c....%d",y.ch, y.i);
}
Answer: Option B
Q57
Find the output
void main ()
{
struct zzz
{
int i;
int j;
}pqr;
struct zzz *z;
z=&pqr;
z->=100
z->=200;
xxx (z);
}
xxx (int *p)
{
p++;
printf("%d", *p);
}
Answer: Option B
Q58
Find the output
struct xxx
{
int age;
char name [10];
};
void main ( )
{
struct xxx *p={26, "raja"};
printf('%s", p->name);
}
Answer: Option D
Q59
Find the output
union complex
{
int i;
float real;
};
void main( )
{
union complex c={2};
printf ("%d %f", c.i,c.real);
}
Answer: Option C
Q60
Find the output
struct str
{
int i;
float f;
};
union uti
{
int i;
float f;
};
void main ( )
{
printf("%d", sizeof (struct str) - sizeof (union uti));
}
Answer: Option C