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
What will be the output of the following C code? int x = 5; if (x > 3) printf("A"); else printf("B");
Which of the following is NOT a valid control flow statement in C?
What is the output of this code? for (int i = 0; i < 3; i++) printf("%d ", i);
What is the difference between 'break' and 'continue' in loops?
Analyze the ternary operator: int x = (5 > 3) ? 10 : 20; What is the value of x?
What is the behavior of goto in C?
Which statement is used to skip remaining iterations and move to next iteration?
In C, which control flow statement is used to terminate a loop prematurely?
What is the primary difference between a while loop and a do-while loop?
In a nested loop structure, which statement will skip only the inner loop's current iteration?
In the expression (x > 5) ? (y = 10) : (y = 20), what does y equal if x is 3?
Which control flow structure allows execution of code only if a certain condition is met?
In a switch statement, which keyword provides a default case if no cases match?
What is the correct syntax for a for loop that iterates from 0 to 9?
Which control structure allows checking multiple conditions in sequence using else-if?
Which keyword is used to exit a loop prematurely in C?
Analyze the code: What happens when condition in if statement is false? if(0) { statements; } else { statements; }
In the ternary operator (? :), what happens if the condition is false?
What will be the result? for(int i = 1; i <= 4; i++) { if(i == 3) break; printf("%d ", i); }
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");