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

Consider a scenario where you need to store a variable that can hold values up to 10 billion. Which data type is most suitable?

Q.182Hard

What happens when a volatile variable is declared in a multi-threaded C program?

Q.183Easy

In C programming, when you declare a variable as 'const int x = 5;', what happens if you try to modify it within the program?

Q.184Easy

What will be the output of the following C code?
int x = 5;
if (x > 3)
printf("A");
else
printf("B");

Q.185Easy

Which of the following is NOT a valid control flow statement in C?

Q.186Easy

What is the output of this code?
for (int i = 0; i < 3; i++)
printf("%d ", i);

Q.187Easy

What is the difference between 'break' and 'continue' in loops?

Q.188Medium

What will be printed?
int x = 0;
if (x = 5)
printf("True");
else
printf("False");

Q.189Medium

What is the output?
for (int i = 1; i <= 5; i++) {
if (i == 3) break;
printf("%d ", i);
}

Q.190Medium

What does the following nested if-else produce?
int a = 10, b = 20;
if (a > b)
if (b > 0)
printf("X");
else
printf("Y");

Q.191Medium

What is the output of this switch statement?
int x = 2;
switch(x) {
case 1: printf("One"); break;
case 2: printf("Two");
case 3: printf("Three"); break;
default: printf("Other");
}

Q.192Medium

How many times will this loop execute?
for (int i = 0; i < 5; ++i) {
if (i == 2) continue;
if (i == 4) break;
}

Q.193Medium

What is printed by this code?
int x = 5;
while (x-- > 0)
printf("%d ", x);

Q.194Medium

What is the output?
int n = 1;
do {
printf("%d ", n);
n++;
} while (n > 5);

Q.195Easy

Analyze the ternary operator: int x = (5 > 3) ? 10 : 20; What is the value of x?

Q.196Hard

What is the output of this program?
for (int i = 1; i <= 3; i++)
for (int j = 1; j <= 2; j++)
printf("%d", i*j);
printf("\n");

Q.197Easy

What is the behavior of goto in C?

Q.198Medium

Determine the output:
int i = 0;
while (i < 3) {
printf("%d ", i++);
}

Q.199Medium

What does this code segment output?
for (int i = 0; i < 5; i++) {
if (i % 2 == 0) continue;
printf("%d ", i);
}

Q.200Easy

Which statement is used to skip remaining iterations and move to next iteration?