Programming Languages
🟢 75 Verified MCQs • 5 Complete Chapters Active
⭐ Interview & Exam Grade
C Programming: 5-Chapter Comprehensive Practice & 75 Verified MCQs
Master C Programming with our complete 5-chapter question bank. Each verified MCQ provides four distinct options, verified solution keys, step-by-step technical rationale, and high-yield conceptual rules.
Curriculum Roadmap & Chapters Covered (All Live & Unlocked):
✓
Chapter 1: Operators, Expressions & Precedence (Q1 – Q15)
✓
Chapter 2: Pointers, Arithmetic & Memory Allocation (Q16 – Q30)
✓
Chapter 3: Functions, Storage Classes & Recursion (Q31 – Q45)
✓
Chapter 4: Control Structures, Loops & Logic (Q46 – Q60)
✓
Chapter 5: Arrays, Strings, Structs & File I/O (Q61 – Q75)
📝 Total Questions: 75 Verified MCQs
📚 Modules: 5 Complete Chapters
⏱️ Est. Practice Time: ~90 minutes
🎯 Target Benchmark: 80% (60/75 Correct)
Select Chapter to Practice:
Interactive Practice Dashboard
Answered: 0 / 75
Correct: 0
Accuracy: 0%
Streak: 🔥 0
Curriculum Track • Module 1 of 5
Chapter 1: Operators, Expressions & Precedence (Q1 – Q15)
Question 1 of 75
Chapter 1
Which operator in C is used to dereference a pointer variable and access the value residing at the pointed memory address?
Question 2 of 75
Chapter 1
What will be the printed output of the following C code snippet?
int x = 5;
int y = ++x * 2;
printf("%d %d", x, y);
int x = 5;
int y = ++x * 2;
printf("%d %d", x, y);
int x = 5;
int y = ++x * 2;
printf("%d %d", x, y);
Question 3 of 75
Chapter 1
Which bitwise expression in C isolates and checks whether the 3rd bit (0-indexed from right) of an integer variable 'flags' is set to 1?
Question 4 of 75
Chapter 1
How does the logical AND operator (&&) behave in C when the left-hand operand evaluates to false (0)?
Question 5 of 75
Chapter 1
What is the return value and behavior of the sizeof operator in C when evaluated on an array vs a decayed pointer?
int arr[10];
int *ptr = arr;
printf("%zu %zu", sizeof(arr), sizeof(ptr));
Question 6 of 75
Chapter 1
According to the C99 and C11 standards, what is the result of the modulo operation (-14 % 3)?
Question 7 of 75
Chapter 1
What will be printed by the following code that utilizes the comma operator?
int a = (1, 2, 3) + (4, 5);
printf("%d", a);
int a = (1, 2, 3) + (4, 5);
printf("%d", a);
int a = (1, 2, 3) + (4, 5);
printf("%d", a);
Question 8 of 75
Chapter 1
What is the primary difference between the bitwise NOT operator (~) and the logical NOT operator (!) in C?
Question 9 of 75
Chapter 1
What does the expression 'ptr++' do when ptr is a pointer of type 'int *' on a 64-bit architecture where sizeof(int) is 4 bytes?
Question 10 of 75
Chapter 1
Which of the following operators cannot be used with floating-point operands (float, double) in C?
Question 11 of 75
Chapter 1
In the expression 'int res = a > b ? a : b;', what is the operator category and arity of '?:'?
Question 12 of 75
Chapter 1
What will be the output of the following C code snippet?
int x = 10, y = 20, z = 30;
int r = x < y < z;
printf("%d", r);
int x = 10, y = 20, z = 30;
int r = x < y < z;
printf("%d", r);
int x = 10, y = 20, z = 30;
int r = x < y < z;
printf("%d", r);
Question 13 of 75
Chapter 1
What is the order of evaluation between prefix increment and pointer dereference in the expression '*++ptr'?
Question 14 of 75
Chapter 1
Which bitwise operation clears (sets to 0) the least significant set bit (rightmost 1) of an unsigned integer 'n' in O(1) time?
Question 15 of 75
Chapter 1
What will be printed when executing the following C code?
int a = 1;
if (a = 0)
printf("True\n");
else
printf("False\n");
int a = 1;
if (a = 0)
printf("True\n");
else
printf("False\n");
int a = 1;
if (a = 0)
printf("True\n");
else
printf("False\n");Curriculum Track • Module 2 of 5
Chapter 2: Pointers, Arithmetic & Memory Allocation (Q16 – Q30)
Question 16 of 75
Chapter 2
What is the return type of the malloc() function in C when memory is successfully allocated?
Question 17 of 75
Chapter 2
What happens if free(ptr) is called on a pointer variable that holds the value NULL?
Question 18 of 75
Chapter 2
What is a 'Dangling Pointer' in C?
Question 19 of 75
Chapter 2
How does calloc(n, size) differ functionally from malloc(n * size)?
Question 20 of 75
Chapter 2
What will be printed when executing the following pointer arithmetic snippet on a 32-bit architecture where sizeof(int) is 4 bytes?
int arr[5] = {10, 20, 30, 40, 50};
int *p = arr;
printf("%d", *(p + 3));
int arr[5] = {10, 20, 30, 40, 50};
int *p = arr;
printf("%d", *(p + 3));
int arr[5] = {10, 20, 30, 40, 50};
int *p = arr;
printf("%d", *(p + 3));
Question 21 of 75
Chapter 2
What is the difference between 'const int *p' and 'int * const p' in C declarations?
Question 22 of 75
Chapter 2
What does realloc(ptr, new_size) do if there is insufficient contiguous space at the current memory block to expand?
Question 23 of 75
Chapter 2
What is the result of subtracting two pointers pointing to elements in the same array: (ptr2 – ptr1)?
int arr[10];
int *ptr1 = &arr[2];
int *ptr2 = &arr[7];
printf("%td", ptr2 - ptr1);
Question 24 of 75
Chapter 2
What is a 'Memory Leak' in C?
Question 25 of 75
Chapter 2
What is the output of the following pointer dereferencing code?
int x = 100;
int *p = &x;
int **pp = &p;
printf("%d", **pp);
int x = 100;
int *p = &x;
int **pp = &p;
printf("%d", **pp);
int x = 100;
int *p = &x;
int **pp = &p;
printf("%d", **pp);
Question 26 of 75
Chapter 2
What is a 'Wild Pointer' in C?
Question 27 of 75
Chapter 2
Can you perform direct arithmetic (e.g. ptr++) on a pointer declared as 'void *' according to standard ANSI C?
void *ptr = malloc(100);
ptr++;
Question 28 of 75
Chapter 2
What does the declaration 'int (*fp)(int, int);' declare in C?
Question 29 of 75
Chapter 2
What will occur if a program attempts to write data to a string literal through a pointer: 'char *str = "Hello"; str[0] = 'M';'?
char *str = "Hello";
str[0] = 'M';
Question 30 of 75
Chapter 2
What is the purpose of the 'alloca()' function in environments where it is supported?
Curriculum Track • Module 3 of 5
Chapter 3: Functions, Storage Classes & Recursion (Q31 – Q45)
Question 31 of 75
Chapter 3
What is the lifetime and scope of a local variable declared with the 'static' storage class specifier inside a function?
void counter() {
static int count = 0;
count++;
printf("%d ", count);
}
Question 32 of 75
Chapter 3
What does declaring a global variable or function with the 'static' keyword at file scope achieve?
static int global_config = 42;
Question 33 of 75
Chapter 3
What is the default storage class of local variables declared inside a C function if no storage specifier is provided?
Question 34 of 75
Chapter 3
What purpose does the 'extern' storage class specifier serve in a C program?
extern int system_state;
Question 35 of 75
Chapter 3
What will occur if a recursive function in C lacks a proper base case or terminates too deeply?
Question 36 of 75
Chapter 3
What is 'Tail Recursion', and why is it significant for optimizing compilers?
int fact(int n, int acc) {
if (n <= 1) return acc;
return fact(n - 1, n * acc); // tail call
}
Question 37 of 75
Chapter 3
What does the 'inline' function specifier suggest to the C compiler (introduced in C99)?
inline int add(int a, int b) {
return a + b;
}
Question 38 of 75
Chapter 3
How are function arguments passed by default in C?
Question 39 of 75
Chapter 3
What is the consequence of declaring a variable with the 'register' storage class in C?
register int i;
Question 40 of 75
Chapter 3
What will be printed when executing the following recursive function with input n = 4?
void print_nums(int n) {
if (n == 0) return;
print_nums(n – 1);
printf("%d ", n);
}
void print_nums(int n) {
if (n == 0) return;
print_nums(n – 1);
printf("%d ", n);
}
void print_nums(int n) {
if (n == 0) return;
print_nums(n - 1);
printf("%d ", n);
}
Question 41 of 75
Chapter 3
Which header file and macros must be used to create functions accepting variable numbers of arguments (variadic functions) in C?
void log_msg(const char *fmt, ...);
Question 42 of 75
Chapter 3
What is the return value of a function in C if the return statement is omitted in a non-void function (other than main)?
int calculate(int a) {
int res = a * 2;
// return omitted
}
Question 43 of 75
Chapter 3
What is the difference between a function declaration (prototype) and a function definition in C?
Question 44 of 75
Chapter 3
What does the 'noreturn' function specifier (or '_Noreturn' in C11) signify?
_Noreturn void terminate_app();
Question 45 of 75
Chapter 3
In C, what is the maximum number of values a function can return directly via the return statement?
Curriculum Track • Module 4 of 5
Chapter 4: Control Structures, Loops & Logic (Q46 – Q60)
Question 46 of 75
Chapter 4
What happens if a 'break' statement is omitted at the end of a 'case' block in a C switch statement?
switch(val) {
case 1: printf("A ");
case 2: printf("B "); break;
}
Question 47 of 75
Chapter 4
What data types are legally permitted as the expression inside a switch() statement in C?
Question 48 of 75
Chapter 4
What is the primary difference between a 'while' loop and a 'do-while' loop in C?
Question 49 of 75
Chapter 4
What is the behavior of the 'continue' statement when executed inside a C 'for' loop?
for (int i = 0; i < 5; i++) {
if (i == 2) continue;
printf("%d ", i);
}
Question 50 of 75
Chapter 4
What will be printed when executing the following nested loop?
int count = 0;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 4; j++)
count++;
printf("%d", count);
int count = 0;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 4; j++)
count++;
printf("%d", count);
int count = 0;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 4; j++)
count++;
printf("%d", count);
Question 51 of 75
Chapter 4
What is the scope restriction of the 'goto' statement in C?
Question 52 of 75
Chapter 4
What will occur if the condition expression is completely omitted in a for loop: 'for ( ; ; ) { … }'?
for ( ; ; ) {
// body
}
Question 53 of 75
Chapter 4
What is the output of the following code snippet?
int x = 0;
if (x++)
printf("A ");
else
printf("B ");
printf("%d", x);
int x = 0;
if (x++)
printf("A ");
else
printf("B ");
printf("%d", x);
int x = 0;
if (x++)
printf("A ");
else
printf("B ");
printf("%d", x);
Question 54 of 75
Chapter 4
Can a 'default' case be placed at the top or middle of a switch statement in C rather than at the bottom?
switch(val) {
default: printf("Def "); break;
case 1: printf("One "); break;
}
Question 55 of 75
Chapter 4
What will be printed when executing this loop?
int i = 5;
while (i –> 0) {
printf("%d ", i);
}
int i = 5;
while (i –> 0) {
printf("%d ", i);
}
int i = 5;
while (i --> 0) {
printf("%d ", i);
}
Question 56 of 75
Chapter 4
What is the primary danger of using floating-point loop control variables, such as 'for (float f = 0.0f; f != 1.0f; f += 0.1f)'?
for (float f = 0.0f; f != 1.0f; f += 0.1f) {
// ...
}
Question 57 of 75
Chapter 4
What is the effect of an empty statement ';' inside a while loop header: 'while (condition);'?
int i = 0;
while (i < 5);
{
i++;
}
Question 58 of 75
Chapter 4
In a switch statement, can two different 'case' labels share the exact same constant value?
switch(x) {
case 1: ... break;
case 1: ... break;
}
Question 59 of 75
Chapter 4
What is the purpose of 'Duff’s Device' in C programming?
Question 60 of 75
Chapter 4
What does a 'break' statement do when executed inside a nested loop in C?
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (j == 1) break;
}
}Curriculum Track • Module 5 of 5
Chapter 5: Arrays, Strings, Structs & File I/O (Q61 – Q75)
Question 61 of 75
Chapter 5
What character implicitly terminates all valid C string literals in memory?
Question 62 of 75
Chapter 5
What is 'Structure Padding' and alignment in C?
struct Example {
char a; // 1 byte
int b; // 4 bytes
};
Question 63 of 75
Chapter 5
How does a 'union' differ from a 'struct' in C?
union Data {
int i;
float f;
char str[20];
};
Question 64 of 75
Chapter 5
Why is the standard library function 'gets()' considered hazardous and formally removed from the C11 standard?
char buf[50];
gets(buf); // DEPRECATED & REMOVED
Question 65 of 75
Chapter 5
What does the file open mode "r+" specify in fopen()?
FILE *fp = fopen("data.txt", "r+");
Question 66 of 75
Chapter 5
What will be printed when comparing two identical string literals using '==' instead of 'strcmp()' in C?
char s1[] = "test";
char s2[] = "test";
if (s1 == s2) printf("Same"); else printf("Diff");
char s1[] = "test";
char s2[] = "test";
if (s1 == s2) printf("Same"); else printf("Diff");
char s1[] = "test";
char s2[] = "test";
if (s1 == s2) printf("Same"); else printf("Diff");
Question 67 of 75
Chapter 5
What is the return value of 'fclose(fp)' upon successful closure of a file stream?
Question 68 of 75
Chapter 5
What is a 'Bit-field' inside a C structure definition?
struct Flags {
unsigned int is_ready : 1;
unsigned int mode : 3;
};
Question 69 of 75
Chapter 5
What function in the standard library safely copies at most N bytes from one string to another, helping prevent buffer overflows?
Question 70 of 75
Chapter 5
What is the function of 'fseek(fp, offset, whence)' in C file operations?
Question 71 of 75
Chapter 5
What is the return value of 'feof(fp)' in C?
Question 72 of 75
Chapter 5
What does the 'typedef' keyword accomplish in C?
typedef unsigned long long uint64_t;
Question 73 of 75
Chapter 5
What is the difference between binary file mode ("rb", "wb") and text file mode ("r", "w") in C on Windows platforms?
Question 74 of 75
Chapter 5
What does the 'fflush(fp)' function do on an output stream?
fflush(stdout);
Question 75 of 75
Chapter 5
How does 'snprintf()' differ from 'sprintf()' in C?
snprintf(buf, sizeof(buf), "User ID: %d", id);Explore Other Comprehensive 75-Question Subject Tracks
Continue your preparation across our active curriculum tracks. Every track provides 75 verified questions across 5 complete chapters.
Active Track
📍 C Programming
75 Qs • 5 Chapters (You are here)
🟢 100% Live Track
Python Programming
75 Qs • 5 Chapters • Practice Now →
🟢 100% Live Track
Data Structures
75 Qs • 5 Chapters • Practice Now →
🟢 100% Live Track
DBMS & SQL
75 Qs • 5 Chapters • Practice Now →
🟢 100% Live Track
Computer Networks
75 Qs • 5 Chapters • Practice Now →
🟢 100% Live Track
Operating Systems
75 Qs • 5 Chapters • Practice Now →
🟢 100% Live Track
Quantitative Aptitude
75 Qs • 5 Chapters • Practice Now →