Examlex

Solved

What Is the Output of the Following Segment of Code

question 24

Multiple Choice

What is the output of the following segment of code if 4 is input by the user when asked to enter a number?
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;


Definitions:

Professional Networking

The process of establishing a web of professional contacts to exchange information, advice, and support in a business or career context.

Career Development Portfolio

A comprehensive collection of documents and materials that showcase an individual's professional growth, skills, achievements, and experiences.

Career Goal

A predetermined professional objective or ambition that an individual aims to achieve in the future.

Technology Infrastructural Architect

A professional responsible for designing and implementing the underlying technology frameworks that support data processing and information systems in an organization.

Related Questions