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

Which header file is required for dynamic memory allocation functions?

Q.2Easy

What does calloc() do differently from malloc()?

Q.3Easy

Which function is used to free dynamically allocated memory?

Q.4Easy

How much memory is allocated by malloc(sizeof(int) * 10) on a 32-bit system where sizeof(int) = 4?

Q.5Easy

Which header file must be included to use malloc(), calloc(), and free() functions?

Q.6Easy

What is the key difference between malloc() and calloc()?

Q.7Easy

What happens when you call free() on a NULL pointer?

Q.8Easy

Which statement best describes dynamic memory allocation's advantage over static allocation?

Q.9Easy

What is the correct way to allocate and initialize a structure dynamically?
struct Node { int data; int next; };

Q.10Easy

Which header file must be included for dynamic memory allocation functions in C?

Q.11Easy

What is the return type of malloc()?

Q.12Easy

How much memory in bytes does calloc(10, 4) allocate?

Q.13Easy

Which header file must be included to use dynamic memory allocation functions in C?

Q.14Easy

What does free() function do in C?

Q.15Easy

What is the primary difference between malloc() and calloc()?

Q.16Easy

Which of the following correctly allocates memory for an array of 5 integers and initializes to zero?

Q.17Easy

Which function in C is used to allocate memory dynamically at runtime?

Q.18Easy

Which header file must be included to use malloc() and free() functions?

Q.19Easy

What happens when malloc() fails to allocate memory?

Q.20Easy

What is the result of calling free() on a NULL pointer?