C Programming - C Structures And Unions Questions and Answers

In the C language structures are used to group together different types of variables under the same name. Following question bank related to the MCQ questions about C structures and unions
1. What is the output of following C code?
struct emp
char name[20];
int age;
float sal;
struct emp e ={"Tiger"}
[A] Error
[B] Garbage Collection
[C] 0 0.000000
[D] 1 0.000000
2. Which of the following comment about the usage of structures in true?
[A] Storage class can be assigned to individual member
[B] Individual members can be initialized within a structure type declaration
[C] The scope of the member name is confined to the particular structure, within which it is defined
[D] None of above
3. Which of the following comment about Union is false?
[A] Union is a structure whose members share same memory area
[B] The compiler will keep track of what type of information is currently stored
[C] Only one of the members of union can be assigned a value at particular time
[D] Size allocated for Union is the size of its member needing the maximum storage
4. Which of the following is a collection of different data types?
[A] String
[B] Array
[C] Structure
[D] Files
5. For accessing a structure element using a pointer,you must use?
[A] Pointer operator (&)
[B] Dot operators(.)
[C] Pointer operator(*)
[D] Arrow operator(->)
6. Which operator is used to connect structure name to its member name?
[A] dot operator(.)
[B] logical operator(&&)
[C] pointer operator(&)
[D] Arrow operator(->)
7. In C, structure values can be passed as arguments to function by?
[A] passing each member of the structure as an argument of function call
[B] passing copy of the entire structure to the called function
[C] passing structure as an argument using pointer
[D] All of above
8. A -> B is syntactically correct if?
[A] a and b are structure
[B] a is a structure and b is a pointer to structure
[C] a is a pointer to structure and b is a structure
[D] a is a pointer to structure in which b is a field
Are these questions helpful for you?

Post your questions here and start a good conversation with experties and users.

Comments: (Your feedback is valuable to us)

k.sai sandeep 7 months ago Reply

its awesome

Mital Patel 1 year ago Reply

Its really userful.

amit kumar saini 2 years ago Reply

nyc mcq
give more quize

Prafulla Vyas 3 years ago Reply