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

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

Q.82Easy

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

Q.83Hard

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

Q.84Easy

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

Q.85Medium

Which of the following is valid pointer comparison?

Q.86Medium

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

Q.87Hard

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

Q.88Hard

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

Q.89Hard

What is the relationship between arrays and pointers?

Q.90Hard

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

Q.91Easy

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

Q.92Easy

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

Q.93Medium

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

Q.94Easy

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

Q.95Medium

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

Q.96Medium

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

Q.97Medium

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

Q.98Medium

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

Q.99Hard

What is the output of this code? char str[] = "GATE"; char *p = str; printf("%c %c", *p, *(p+3));