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 89 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
YES! Correct, THANKS for helping me on my review


miss_1456@hotmail.com

  • Member
  • Posts: 289
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

Dogs have been used in studies to detect various cancers in human subjects. They have been trained to sniff breath samples from humans that were collected by having them breathe into special tubes. These people included 55 lung cancer patients, 31 breast cancer patients, and 83 cancer-free patients. The dogs detected 54 of the 55 lung cancer patients as having cancer, detected 28 of the 31 breast cancer patients, and gave only three false-positive results (detecting cancer in people who didn't have it).

Did you know?

Asthma is the most common chronic childhood disease in the world. Most children who develop asthma have symptoms before they are 5 years old.

Did you know?

Blastomycosis is often misdiagnosed, resulting in tragic outcomes. It is caused by a fungus living in moist soil, in wooded areas of the United States and Canada. If inhaled, the fungus can cause mild breathing problems that may worsen and cause serious illness and even death.

Did you know?

Your chance of developing a kidney stone is 1 in 10. In recent years, approximately 3.7 million people in the United States were diagnosed with a kidney disease.

Did you know?

Most women experience menopause in their 50s. However, in 1994, an Italian woman gave birth to a baby boy when she was 61 years old.

For a complete list of videos, visit our video library