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

In the expression: int arr[5]; int *p = arr; What does p + 2 represent?

Q.42Medium

What is the purpose of the const keyword in: int * const p;?

Q.43Medium

Which scenario demonstrates a dangling pointer?

Q.44Medium

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

Q.45Medium

Which of the following is valid pointer comparison?

Q.46Medium

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

Q.47Medium

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

Q.48Medium

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

Q.49Medium

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

Q.50Medium

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

Q.51Medium

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