ASSESSMENT A · SESSIONS 7–10
Concept & Logic Test
Conditionals · Switch Statements · Loops
S1
Conditionals (Sessions 7–8)
18 ptsQ1 4 pts — MCQ: Which operator checks equality in C?
Q2 6 pts — Trace: What is the output of this code?
int age = 15;
if (age >= 18) {
printf("Adult");
} else if (age >= 13) {
printf("Teen");
} else {
printf("Child");
}
Your answer:
Q3 8 pts — Concept: Explain with example:
Your answer:
S2
Switch Statements (Session 9)
14 ptsQ4 4 pts — MCQ: What is the role of
break in switch?Q5 5 pts — Trace: What is the output when
choice = 2?switch(choice) {
case 1: printf("One"); break;
case 2: printf("Two"); break;
default: printf("Other");
}
Your answer:
Q6 5 pts — Short answer: Why can switch be better than many if-else blocks in menu programs?
Your answer:
S3
Loops (Session 10)
18 ptsQ7 4 pts — MCQ: Which loop is best when repetitions are known (e.g. 1 to 10)?
Q8 6 pts — Trace: What is the output?
for (int i = 1; i <= 5; i++) {
if (i == 3) continue;
printf("%d ", i);
}
Your answer:
Q9 8 pts — Concept: Explain difference between:
Your answer:
Turn in your test online
Sign in with Google (the account your class uses). Your answers are sent securely for grading. Your work auto-saves in this browser until you submit.