What is the output of the following segment of code if the value 4 is input by the user? int num; int total = 0; cout > num; switch (num) { case 1: case 2: total = 5; case 3: total = 10; case 4: total...


What is the output of the following segment of code if the value4is input by the user?

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=""><>



Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here