iGET

C Programming - MCQ Practice Questions

Practice free C Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

978 questions | 100% Free

Q.1Easy

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

Q.2Easy

What will be the output of sizeof(union test) if union has members: int a, char b, float c?

Q.3Easy

Which keyword is used to define a structure in C?

Q.4Easy

What is the size of the following structure? struct point { int x; int y; float z; };

Q.5Easy

Can we pass a structure variable to a function in C?

Q.6Easy

Which of the following is a key difference between struct and union in C?

Q.7Easy

What will be the output of sizeof() for the following union? union data { int a; float b; double c; }

Q.8Easy

In C, what is a self-referential structure?

Q.9Easy

Which keyword is used to define a new name for a structure in C?

Q.10Easy

What is the purpose of padding in C structures?

Q.11Easy

How do you access a structure member through a pointer in C?

Q.12Easy

What is the primary advantage of using structures in C?

Q.13Easy

What is the output of the following code? struct Point { int x; int y; }; struct Point p = {5}; printf("%d %d", p.x, p.y);

Q.14Easy

Which of the following is true about typedef struct?

Q.15Easy

Consider union u { int i; char c; float f; }; What is the size of this union?

Q.16Easy

Which of these is a valid declaration of a structure variable using dot operator immediately after struct definition?

Q.17Easy

Which of the following correctly demonstrates self-referential structure (for linked list)?

Q.18Easy

When structure is passed by value to a function, which of these is true?

Q.19Easy

What is the correct way to dynamically allocate an array of structures? struct Student { int roll; char name[50]; };

Q.20Easy

Which of the following statements about unions is correct?