Hello students welcome to CSE Study247 Today I am provide you MCQ on Structure and Union in c.
This page provide 20 Multiple choice question with Answer that is very useful of Computer science students like preparation of many exam Like ( ISRO,DRDO ,Semester, Interview, TCS , Railway & another Government Sector)
❤️ TOP 500+ C Programming Question and Answer
C programming is the basic language of programming that help to learn another language. So this MCQ is very useful for you.

C is a general purpose ,high level language that originally developed by Dennis Ritchie to develop the UNIX operating system at Bell labs.
Q.1 Structure is a _____ data type.
Predefine
User Define
Can't be said
None
Explanation
A structure is a user-defined data type in C that allows you to combine different data types under a single name.
Q.2 Structure members are accessed using the _____ operator.
dot
assignment
logical
None
Explanation
The dot operator (.) is used to access members of a structure variable.
Q.3 Union is a?
Primitive data type
User define data type
Both A & B
None
Explanation
Like a structure, a union is a user-defined data type where all members share the same memory location.
Q.4 A C Structure or User defined data type is also called?
Secondary data type
Derived data type
Both A & B
None
Explanation
Structures are categorized as both secondary and derived data types because they are constructed using primary data types.
Q.5 Find out the output: struct man { int c; } man1; man1.c=4; printf('Child=%d', man1.c);
Child
Child=0
Child=4
Compiler Error
Explanation
The program assigns the value 4 to the member ‘c’ of structure variable ‘man1’ and prints it correctly.
Q.6 Which of the following allows to combine data items of different kinds?
Array
Function
Structure
None
Explanation
A structure is used to group variables of different data types, whereas an array groups variables of the same data type.
Q.7 The restriction with union initialization is?
The last member can be initialized
The first member can be initialized
Any member can be initialized
None
Explanation
In standard C (C89), only the first member of a union can be explicitly initialized.
Q.8 Which of the following operations is illegal in structures?
Pointer to a variable of the same structure
Typecasting of structure
Dynamic allocation of memory for structure
None
Explanation
You cannot typecast a whole structure to another type directly; however, you can typecast a pointer to a structure.
Q.9 Which of the following uses structure?
Array of structure
Linked list
Binary tree
All of these
Explanation
Complex data structures like linked lists, trees, and arrays of records are implemented using structures.
Q.10 Number of bytes in memory taken by: struct test { int a; char b; };
Multiple of word size
integer size + character size
can't be said
None
Explanation
The total size is the sum of the sizes of its members, though compilers may add padding for alignment.
Q.11 In a structure, the operator '.' is called as?
period operator
dot operator
Both A & B
None
Explanation
The ‘.’ operator is formally known as the member access operator, but is commonly called the dot or period operator.
Q.12 A structure is used when we wish to store _____ data.
Dissimilar
Similar
Identical
None
Explanation
Structures are designed to store a collection of dissimilar data types (e.g., an int and a string together).
Q.13 Identify the correct statement regarding nested members?
Union can be member of structure
Structure can be member of union
Both A & B
None
Explanation
C allows nesting where a union can be a member of a structure and vice versa.
Q.14 Which of the following cannot be a structure member?
Array
Function
Structure
None
Explanation
A structure can contain a pointer to a function, but it cannot contain a function definition as a member.
; } a; strcpy(a.name,’computer’); a.items=525; printf(‘Name=%s items=%d’,a.name,a.items);” a=”Compiler Error” b=”Garbage value” c=”Name=computer items=525″ d=”None” correct=”c” ans=”The members are correctly assigned using string copy and direct assignment, then printed as per the format string.”]
Q.16 A structure is a?
collection of elements that can be of same data type
Elements of a structure are called members
collection of elements that can be of different data type
All of these
Explanation
A structure groups members of potentially different types, and each element within it is referred to as a member.
Q.17 To access the members of a structure using a pointer to that structure, you must use the _____ operator.
&
*
::
–
Explanation
The arrow operator (- ) is specifically used to access structure members through a pointer.
Q.18 Which operator connects the structure name to its member name?
–
.
&
*
Explanation
For a regular structure variable, the dot operator (.) is used to connect the variable name to the member name.
Q.19 Which of the following are themselves a collection of different data types?
String
Structure
Char
int
Explanation
A structure is a compound data type specifically designed to hold a collection of different types.
; float marks; } std[12];” a=”40″ b=”12″ c=”480″ d=”28″ correct=”c” ans=”A union’s size is the size of its largest member (40 bytes). Since there is an array of 12 unions, the total size is 12 * 40 = 480 bytes.”]
| 1. Official Telegram | Click Here |
| 2. Telegram For CSE MCQs | Click Here |
| 3. You Tube | Click Here |