+ 1

What's wrong with the code from the switch statement pro practice run? Or is it a bug

#include <iostream> using namespace std; int main() { int choice = 0; cin >> choice; /*1 - Latte 2 - Americano 3 - Espresso 4 - Cappuccino 5 - Macchiato */ //your code goes here switch (choice){ case 1: cout<<"Latte"; break; case 2: cout <<"Americano"; break; case 3: cout <<"Espresso"; break; case 4: cout <<"Cappuccino"; case 5: cout <<"Macchiato"; break; } return 0; }

6th Jul 2022, 9:06 AM
Mr Sir
Mr Sir - avatar
2 Answers
+ 1
Case 4 missing a break..
6th Jul 2022, 9:10 AM
Jayakrishna 🇼🇳
+ 1
Oh yeah thanks
6th Jul 2022, 9:11 AM
Mr Sir
Mr Sir - avatar