C Structure and Union - C programming (MCQ) questions

Here, you can read C Structure and Union multiple choice questions and answers with explanation.

1)   What will be the size of the following structure?

#include <stdio.h>
struct temp
{
     int a[10];
     char p;
};

- Published on 26 Feb 17

a. 5
b. 11
c. 41
d. 44
Answer  Explanation 

ANSWER: 44

Explanation:
No explanation is available for this question!


2)   Which among the following is never possible in C when members in a structure are same as that in a union?

    //Let P be a structure
    //Let Q be a union

- Published on 26 Feb 17

a. sizeof(P) is greater than sizeof(Q)
b. sizeof(P) is equal to sizeof(Q)
c. sizeof(P) is less than to sizeof(Q)
d. None of the above
Answer  Explanation 

ANSWER: sizeof(P) is less than to sizeof(Q)

Explanation:
No explanation is available for this question!


3)   Which among the following is never possible in C when members are different in a structure and union?

    //Let P be a structure
    //Let Q be a union

- Published on 26 Feb 17

a. sizeof(P) is greater than sizeof(Q)
b. sizeof(P) is less than sizeof(Q)
c. sizeof(P) is equal to sizeof(Q)
d. None of the above
Answer  Explanation 

ANSWER: None of the above

Explanation:
No explanation is available for this question!


4)   What is the similarity between a structure, union and enumeration?
- Published on 26 Feb 17

a. All of them let you define new values
b. All of them let you define new data types
c. All of them let you define new pointers
d. All of them let you define new structures
Answer  Explanation 

ANSWER: All of them let you define new data types

Explanation:
No explanation is available for this question!


1