0

Can someone debugg this code for me since the answer should be "cappuccino". Take input as 3

#include <iostream> using namespace std; int main() { int choice ; cin >> choice; /* Coffee Types: 1. Espresso 2. Americano 3. Cappuccino 4. Latte */ switch (choice) { case 1: cout<<"Espresso"; break; case 2: cout<<"Americano"; break; case 3; cout<<"cappuccino"; break; case 4; cout<<"latte"; break; } }

27th Dec 2022, 6:18 PM
Alex Boso Nzaphila
Alex Boso Nzaphila - avatar
3 Answers
+ 4
After case 3 and case 4 should be : and not ;
27th Dec 2022, 6:26 PM
JaScript
JaScript - avatar
+ 2
Save code and share link here.. Instead of copy pasting code. What is your problem with this code actually? Mention it.. use : instead of ; after case option: If you mean output not matching with input 3 then according to description 3,4 options output first letter must be capital letter but you are using small letter.
27th Dec 2022, 6:26 PM
Jayakrishna 🇼🇳
0
Ooh yeah, let me see.
27th Dec 2022, 6:27 PM
Alex Boso Nzaphila
Alex Boso Nzaphila - avatar