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

Which pointer operation is NOT valid in C?

Q.62Medium

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

Q.63Easy

What does void *ptr represent?

Q.64Easy

What is the output?
void swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
int x = 5, y = 10;
swap(&x, &y);
printf("%d %d", x, y);

Q.65Hard

Consider: int arr[] = {1,2,3,4,5}; int *p = arr + 2; What is arr - p?

Q.66Hard

What is malloc(0) likely to return?

Q.67Easy

What is the output?
char str[] = "ABC";
char *p = str;
printf("%c", *(p+2));

Q.68Medium

Which of the following is correct about pointer assignment?
int *p, *q;
p = q; // What happens?

Q.69Medium

What is the output?
int x = 5;
int *const p = &x;
x = 10;
printf("%d", *p);

Q.70Hard

What will be printed?
int *p = (int*)malloc(5 * sizeof(int));
int *q = p;
p = NULL;
free(q);

Q.71Hard

What is the difference between arr and &arr if arr is an array?
int arr[5];

Q.72Medium

What is the output?
int arr[] = {10, 20, 30};
int *p = arr;
printf("%d", sizeof(p));

Q.73Easy

What is the size of a pointer in a 64-bit system?

Q.74Medium

Consider the code: int x = 10; int *p = &x; int q = &p; What is the value of q?

Q.75Medium

Which operation is NOT allowed on void pointers in C without explicit casting?

Q.76Medium

What is the difference between NULL and a wild pointer?

Q.77Medium

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

Q.78Medium

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

Q.79Easy

How does free() handle a NULL pointer?

Q.80Medium

Which scenario demonstrates a dangling pointer?