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

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

Q.82Medium

Which of the following statements about switch case is TRUE?

Q.83Medium

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.84Easy

What is the purpose of the ternary operator (? :) in C?

Q.85Medium

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

Q.86Medium

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

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

Q.88Hard

What is the output? for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) if(i == j) continue; printf("Done");

Q.89Medium

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

Q.90Hard

What will this code print? int x = 0; while(x < 3) { printf("%d ", x++); if(x == 2) continue; printf("X "); }

Q.91Easy

Which statement is true about the goto statement in modern C programming practices?

Q.92Hard

What will be printed? int i = 0, j = 0; for(i = 0; i < 3; i++) { for(j = 0; j < 3; j++) { if(i + j == 2) break; printf("%d%d ", i, j); } }

Q.93Medium

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

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

Q.95Easy

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

Q.96Easy

Consider the following code snippet: int x = 5; do { printf("%d ", x); x--; } while(x > 0); What will be the output?

Q.97Medium

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

Q.98Medium

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

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

Q.100Hard

Consider the code: int sum = 0; for(int i = 1; i <= 10; i++) { if(i % 2 == 0) continue; sum += i; } printf("%d", sum); What will be printed?