Vidyalelo
C Programming · all questions

Structure and Union
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

190

Questions

1/10

Page

Pick an option on a question to see the right answer and solution.

What is the keyword used to define a structure in C?

Select an option to see the answer and solution.

In a structure, what are the members also known as?

Select an option to see the answer and solution.

Which of the following can be a member of a structure?

Select an option to see the answer and solution.

How do you access a member of a structure in C?

Select an option to see the answer and solution.

Which keyword is used to declare a union in C?

Select an option to see the answer and solution.

What is the primary difference between a structure and a union in C?

Select an option to see the answer and solution.

How is the size of a structure determined in C?

Select an option to see the answer and solution.

Which statement correctly defines a structure named "Person" with members "name" and "age" of type char* and int respectively?

Select an option to see the answer and solution.

What does the 'sizeof' operator in C return for a union?

Select an option to see the answer and solution.

Can a structure have another structure as a member in C?

Select an option to see the answer and solution.

Which operator is used to access a union member when the union is a part of a structure?

Select an option to see the answer and solution.

What happens when you assign a value to one member of a union and then access another member in C?

Select an option to see the answer and solution.

Which keyword is used to define an anonymous structure or union within another structure or union?

Select an option to see the answer and solution.

In a union, which member can you access safely after assigning a value to one of its members?

Select an option to see the answer and solution.

Which type of variable should you use if you want to store different types of data at different times within the same memory location?

Select an option to see the answer and solution.

Which of the following is true about the memory allocation of structures and unions in C?

Select an option to see the answer and solution.

In C, can a structure be passed as an argument to a function?

Select an option to see the answer and solution.

What is the purpose of using a typedef with structures and unions in C?

Select an option to see the answer and solution.

When should you use a structure instead of an array in C?

Select an option to see the answer and solution.

What is the purpose of an anonymous union in C?

Select an option to see the answer and solution.