Assessment A
← Assessments
Intermediate
Level
35–45 min
Duration
Concept + Trace
Type
50 pts
Total
S1

Conditionals (Sessions 7–8)

18 pts
Q1 4 pts — MCQ: Which operator checks equality in C?
  • A)   =
  • B)   ==
  • C)   !=
  • D)   >=
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:
  • — Difference between if, if-else, and else-if ladder
  • — When to use logical operators && and ||
Your answer:
S2

Switch Statements (Session 9)

14 pts
Q4 4 pts — MCQ: What is the role of break in switch?
  • A) Stops the whole program
  • B) Exits the current case block
  • C) Goes to default
  • D) Repeats the loop
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 pts
Q7 4 pts — MCQ: Which loop is best when repetitions are known (e.g. 1 to 10)?
  • A) while
  • B) do-while
  • C) for
  • D) switch
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:
  • while and do-while
  • break and continue
  • — Give one practical use-case for each
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.

← Back to Assessments