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.561Medium

Which scenario demonstrates a dangling pointer?

Q.562Medium

For function: void modify(int *x) { *x = 20; } If called as modify(&a), what changes?

Q.563Easy

What is the result of: int x = 5; int *p = &x; int *q = p; if p == q?

Q.564Hard

In pointer to function: int (*ptr)(int, int); What does this declare?

Q.565Easy

What happens with: int arr[10]; int *p = arr; *p = 5; printf("%d", arr[0]);?

Q.566Medium

Which of the following is valid pointer comparison?

Q.567Medium

In: int *p; *p = 10; What is the issue?

Q.568Hard

What is the output of: printf("%p", NULL);?

Q.569Hard

For dynamic 2D array: int arr = (int)malloc(n * sizeof(int*)); What's missing?

Q.570Hard

What is the relationship between arrays and pointers?

Q.571Hard

Consider: const int *p; and int * const q; Which statement is true?

Q.572Easy

What is the output of the following code?
int x = 10;
int *p = &x;
int **q = &p;
printf("%d", **q);

Q.573Easy

Consider the declaration: const int *p; and int * const q;
Which statement is TRUE?

Q.574Medium

For dynamic 2D array allocation using int arr = (int)malloc(n*sizeof(int*)); what must be done next?

Q.575Easy

What is the primary issue with this code?
int *p;
*p = 10;

Q.576Medium

Which of the following is a valid pointer comparison in C?

Q.577Medium

What will be the output?
int arr[5] = {1,2,3,4,5};
int *p = arr;
p += 2;
printf("%d", *p);

Q.578Medium

In pointer to function declaration: int (*ptr)(int, int); which statement is correct?

Q.579Medium

Consider a function void modify(int *x) { *x = 20; } called as modify(&y). What happens?

Q.580Easy

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