This topic contains a solution. Click here to go to the answer

Author Question: What is the output of the following segment of code if the value 4 is input by the user?int num;int ... (Read 88 times)

FButt

  • Hero Member
  • *****
  • Posts: 519
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 << "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;

13
3
23
0
◦ None of these


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by FButt on May 22, 2019

canderson530

  • Sr. Member
  • ****
  • Posts: 317
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




FButt

  • Member
  • Posts: 519
Reply 2 on: May 22, 2019
:D TYSM


Jsherida

  • Member
  • Posts: 314
Reply 3 on: Yesterday
Excellent

 

Did you know?

The oldest recorded age was 122. Madame Jeanne Calment was born in France in 1875 and died in 1997. She was a vegetarian and loved olive oil, port wine, and chocolate.

Did you know?

Throughout history, plants containing cardiac steroids have been used as heart drugs and as poisons (e.g., in arrows used in combat), emetics, and diuretics.

Did you know?

Egg cells are about the size of a grain of sand. They are formed inside of a female's ovaries before she is even born.

Did you know?

The training of an anesthesiologist typically requires four years of college, 4 years of medical school, 1 year of internship, and 3 years of residency.

Did you know?

Immunoglobulin injections may give short-term protection against, or reduce severity of certain diseases. They help people who have an inherited problem making their own antibodies, or those who are having certain types of cancer treatments.

For a complete list of videos, visit our video library