-
Notifications
You must be signed in to change notification settings - Fork 0
cpp01
jayoon edited this page Nov 28, 2022
·
8 revisions
Switch statement
int day = 4;
switch (day) {
case 1:
cout << "Monday";
break;
case 2:
cout << "Tuesday";
break;
case 3:
cout << "Wednesday";
break;
case 4:
cout << "Thursday";
break;
case 5:
cout << "Friday";
break;
case 6:
cout << "Saturday";
break;
case 7:
cout << "Sunday";
break;
}
// Outputs "Thursday" (day 4)
- Pointer and reference
- You can pass this module without doing exercise 06.