iGET

C Programming - MCQ Practice Questions

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

978 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?