Question: Cual es el output del siguiente segment de codigo si 4 es el input del usuario? int num; int total = 0 ; cout <

Cual es el "output" del siguiente segment de codigo si 4 es el input del usuario?
int num;
int total =0;
cout << "Enter a number from 1 to 10: ";
cin >> num;
switch (num)
{
case 1:
case 2: total =5;
case 3: total =10;
case 4: total = total +3;
case 8: total = total +6;
default: total = total +4;
}
cout << total << endl;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!