iGET

C Programming - MCQ Practice Questions

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

972 questions | 100% Free

Q.861Hard

In a dynamic stack implementation for competitive programming, how should you handle reallocation when the stack becomes full?

Q.862Hard

Which of these represents proper error handling for malloc in competitive programming?

Q.863Easy

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

Q.864Medium

Which of the following correctly deallocates a 2D dynamically allocated array created as int **arr?

Q.865Easy

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

Q.866Easy

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

Q.867Medium

What happens when realloc() is called on a pointer allocated by malloc() with a larger size?

Q.868Medium

For implementing a dynamic circular buffer of size n, how many pointers are minimally required?

Q.869Medium

Which scenario is most likely to cause a segmentation fault in dynamic memory?

Q.870Medium

In competitive programming for graph problems, if adjacency list uses dynamic arrays, what is the time complexity of adding an edge?

Q.871Medium

What is the correct way to store variable-length strings dynamically?

Q.872Easy

If malloc() returns NULL, what should a program do?

Q.873Easy

In implementing a dynamic doubly-linked list, what additional field is required compared to singly-linked list?

Q.874Hard

For a dynamic hash table with chaining, if collision occurs, the new element should be inserted where?

Q.875Hard

What is the memory overhead when allocating 1000 integers vs 1 integer in a system with malloc metadata?

Q.876Hard

In competitive coding, when implementing dynamic trees, which traversal is most suitable for level-order?

Q.877Hard

Which memory allocation technique provides better locality of reference for accessing array elements?

Q.878Easy

Which of the following is NOT a preprocessor directive in C?

Q.879Easy

What is the output of the following code? #define MAX 5 int arr[MAX];

Q.880Easy

Which preprocessor directive is used to include standard library files?