Lesson 8 of 50
cControl Flow – switch
7 mins
Course progress16%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 8 of 50
c7 mins
Keep these ideas in mind as you work through the lesson.
switch selects among discrete constant values, often used instead of many if‑else checks.
switch (menu) {
case 1: printf("New Game
"); break;
case 2: printf("Load Game
"); break;
default: printf("Invalid selection
");
}