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

What is the output?
int a = 10;
int *p = &a;
int *q = p;
q = NULL;
printf("%d", *p);

Q.542Medium

Which pointer operation is NOT valid in C?

Q.543Medium

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

Q.544Easy

What does void *ptr represent?

Q.545Easy

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.546Hard

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

Q.547Hard

What is malloc(0) likely to return?

Q.548Easy

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

Q.549Medium

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

Q.550Medium

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

Q.551Hard

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

Q.552Hard

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

Q.553Medium

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

Q.554Easy

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

Q.555Medium

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

Q.556Medium

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

Q.557Medium

What is the difference between NULL and a wild pointer?

Q.558Medium

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

Q.559Medium

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

Q.560Easy

How does free() handle a NULL pointer?