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;
```

a. 0
b. 3
c. 13
d. 23
e. None of these

c. 13

Computer Science & Information Technology

You might also like to view...

Which folder, created when upgrading from a previous version of Windows to Windows 7, contains personal files stored by users of the default Windows XP Administrator account?

a. Windows.oldDocuments and SettingsAdministrator. b. Windows.oldDocuments and SettingsAll Users c. Windows.oldDocuments and SettingsProgram Files d. Windows.oldDocuments and SettingsUsername

Computer Science & Information Technology

Attempting to access a private member of a class outside that class ________.

a) is a run-time error b) is a syntax error c) is a logic error d) can be accomplished using IntelliSense e) None of the above.

Computer Science & Information Technology