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.241Easy

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

Q.242Easy

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

Q.243Easy

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

Q.244Easy

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

Q.245Easy

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

Q.246Easy

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

Q.247Easy

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

Q.248Easy

What is the return type of malloc()?

Q.249Easy

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

Q.250Easy

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

Q.251Easy

What does free() function do in C?

Q.252Easy

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

Q.253Easy

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

Q.254Easy

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

Q.255Easy

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

Q.256Easy

What happens when malloc() fails to allocate memory?

Q.257Easy

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

Q.258Easy

How many bytes are allocated by malloc(sizeof(int) * 10) on a system where int is 4 bytes?

Q.259Easy

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

Q.260Easy

In a dynamic queue implementation, if front pointer is NULL, what does it indicate?