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

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

What does realloc() do?

Q.103Hard

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

Q.104Hard

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

Q.105Hard

What is malloc(0) likely to return?

Q.106Hard

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

Q.107Hard

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

Q.108Hard

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

Q.109Hard

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

Q.110Hard

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

Q.111Hard

What is the relationship between arrays and pointers?

Q.112Hard

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

Q.113Hard

Which statement is true about nested structures in C?

Q.114Hard

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

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

Q.116Hard

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

Q.117Hard

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

Q.118Hard

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

Q.119Hard

In nested structures with pointers, which access method is correct? struct outer { struct inner *ptr; } *o; Accessing inner's member x:

Q.120Hard

What is the relationship between structure alignment and padding in modern C compilers?