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.561Easy

How does free() handle a NULL pointer?

Q.562Medium

Which scenario demonstrates a dangling pointer?

Q.563Medium

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

Q.564Easy

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

Q.565Hard

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

Q.566Easy

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

Q.567Medium

Which of the following is valid pointer comparison?

Q.568Medium

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

Q.569Hard

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

Q.570Hard

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

Q.571Hard

What is the relationship between arrays and pointers?

Q.572Hard

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

Q.573Easy

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

Q.574Easy

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

Q.575Medium

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

Q.576Easy

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

Q.577Medium

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

Q.578Medium

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

Q.579Medium

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

Q.580Medium

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