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

What is the output?
int x = 10;
while(x-- > 5) {
printf("%d ", x);
}

Q.42Medium

Which of the following statements about switch case is TRUE?

Q.43Medium

What will this code output?
for(int i = 1; i <= 3; i++) {
for(int j = 1; j <= i; j++) {
printf("%d", j);
}
printf("\n");
}

Q.44Medium

How many times will the loop execute?
int i = 0;
while(i++ < 5) {
printf("%d ", i);
}

Q.45Medium

What will be the output of this code?
int n = 5;
switch(n) {
case 4: printf("Four");
case 5: printf("Five");
case 6: printf("Six");
break;
default: printf("Other");
}

Q.46Medium

Which control structure would be most efficient to validate if a number is within one of several specific values?

Q.47Medium

In C programming, what is the difference between break in a loop and break in a switch statement?

Q.48Medium

What is the output of this code?
char ch = 'B';
switch(ch) {
case 'A':
case 'B':
case 'C': printf("Vowel");
break;
default: printf("Consonant");
}

Q.49Medium

In a for loop with multiple break statements in different conditions, which break will be executed?

Q.50Medium

In nested loops, if an inner loop contains a break statement, what happens?

Q.51Medium

Analyze this code:
for(int i = 0; i < 5; i++) {
if(i == 2) continue;
if(i == 3) break;
printf("%d ", i);
}
What is the output?

Q.52Medium

Which of the following statements about the switch-case construct is INCORRECT?