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

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

Q.2Easy

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

Q.3Easy

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

Q.4Easy

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

Q.5Easy

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

Q.6Easy

What is the behavior of goto in C?

Q.7Easy

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

Q.8Easy

In C, which control flow statement is used to terminate a loop prematurely?

Q.9Easy

What is the primary difference between a while loop and a do-while loop?

Q.10Easy

In a nested loop structure, which statement will skip only the inner loop's current iteration?

Q.11Easy

In the expression (x > 5) ? (y = 10) : (y = 20), what does y equal if x is 3?

Q.12Easy

Which control flow structure allows execution of code only if a certain condition is met?

Q.13Easy

In a switch statement, which keyword provides a default case if no cases match?

Q.14Easy

What is the correct syntax for a for loop that iterates from 0 to 9?

Q.15Easy

Which control structure allows checking multiple conditions in sequence using else-if?

Q.16Easy

Which keyword is used to exit a loop prematurely in C?

Q.17Easy

Analyze the code: What happens when condition in if statement is false? if(0) { statements; } else { statements; }

Q.18Easy

In the ternary operator (? :), what happens if the condition is false?

Q.19Easy

What will be the result? for(int i = 1; i <= 4; i++) { if(i == 3) break; printf("%d ", i); }

Q.20Easy

What is printed by this code? int x = 1, y = 2; if(x > y) printf("A"); else if(x < y) printf("B"); else printf("C");