Union in C MCQs Exercise I

Ques 1 Union


Which of the following is a keyword of union ?

A Union
B UNION
C union()
D None of the above

Ques 2 Union


What is the size of Union?
union student
{
    char name[12];
    int roll[5];
    float percentage;
}

A 12
B 18
C 26
D 28

Ques 3 Union


What is the output of the code ?
union things{
int a;
float b;
char c;
};
int main()
{
union things d;
d.a=45;
d.b=3.5;
d.c="Grocery";
printf("%d\n",d.a);
printf("%f\n",d.b);
printf("%c\n",d.c);
return 0;
}

A 45 3.50000 grocery
B 35 3.5 Grocery
C 45 3.50000 Gocery
D None of these