iGET

C Programming - MCQ Practice Questions

C questions in placement tests and university exams are rarely about syntax alone. Most of what you will find here is output prediction, pointer arithmetic, arrays and strings, structures and unions, storage classes, recursion, and file handling. The explanations walk through memory behaviour step by step, which is usually where the confusion sits rather than in the code itself.

972 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.6Medium

What happens when you initialize a structure variable without assigning values?

Q.7Medium

Which of the following correctly declares a pointer to a structure?

Q.8Medium

What is the difference between struct and typedef struct?

Q.9Medium

What will be printed?
struct s { int a; char b; int c; }; printf("%lu", sizeof(struct s));

Q.10Medium

How do you access a member of a structure using a pointer?

Q.11Medium

What is the purpose of padding in structures?

Q.12Medium

Consider: union u { int x; double y; }; What is sizeof(u)?

Q.13Hard

Which statement is true about nested structures in C?

Q.14Hard

What happens if you assign a union member and then access another member?
struct u { int a; char b; }; u.a = 257; printf("%d", u.b);

Q.15Hard

How can you initialize a structure array of 10 elements partially in C?

Q.16Hard

What is the difference between self-referential and recursive structures?

Q.17Hard

Given union test { int x; char y[4]; }; If you set y[0]=65, y[1]=66, what happens to x?

Q.18Easy

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

Q.19Easy

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

Q.20Easy

In C, what is a self-referential structure?