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 83 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
Wow, this really help


xoxo123

  • Member
  • Posts: 335
Reply 3 on: Yesterday
YES! Correct, THANKS for helping me on my review

 

Did you know?

The senior population grows every year. Seniors older than 65 years of age now comprise more than 13% of the total population. However, women outlive men. In the 85-and-over age group, there are only 45 men to every 100 women.

Did you know?

Sperm cells are so tiny that 400 to 500 million (400,000,000–500,000,000) of them fit onto 1 tsp.

Did you know?

Each year in the United States, there are approximately six million pregnancies. This means that at any one time, about 4% of women in the United States are pregnant.

Did you know?

Tobacco depletes the body of vitamins A, C, and E, which can result in any of the following: dry hair, dry skin, dry eyes, poor growth, night blindness, abscesses, insomnia, fatigue, reproductive system problems, sinusitis, pneumonia, frequent respiratory problems, skin disorders, weight loss, rickets, osteomalacia, nervousness, muscle spasms, leg cramps, extremity numbness, bone malformations, decayed teeth, difficulty in walking, irritability, restlessness, profuse sweating, increased uric acid (gout), joint damage, damaged red blood cells, destruction of nerves, infertility, miscarriage, and many types of cancer.

Did you know?

The term bacteria was devised in the 19th century by German biologist Ferdinand Cohn. He based it on the Greek word "bakterion" meaning a small rod or staff. Cohn is considered to be the father of modern bacteriology.

For a complete list of videos, visit our video library