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

What is the relationship between arrays and pointers in C?

Q.102Hard

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

Q.103Hard

What does realloc() do?

Q.104Hard

What is the primary use of const pointer (int * const p)?

Q.105Hard

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

Q.106Hard

What is malloc(0) likely to return?

Q.107Hard

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

Q.108Hard

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

Q.109Hard

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

Q.110Hard

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

Q.111Hard

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

Q.112Hard

What is the relationship between arrays and pointers?

Q.113Hard

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

Q.114Hard

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

Q.115Hard

Which statement is true about nested structures in C?

Q.116Hard

What happens if you assign a union member and then access another member? struct u { int a; char b; }; u.a = 257; printf("%d", u.b);

Q.117Hard

How can you initialize a structure array of 10 elements partially in C?

Q.118Hard

What is the difference between self-referential and recursive structures?

Q.119Hard

Given union test { int x; char y[4]; }; If you set y[0]=65, y[1]=66, what happens to x?

Q.120Hard

Which approach is more memory efficient for storing 100 flags: array of char or bit fields in a structure?