What is the output of the following program?#include using namespace std;void doSomething(∫);int main(){int x = 2;cout << x << endl;doSomething(x);cout << x << endl;return 0;}void doSomething(int &num){num = 0;cout << num << endl;}

Answers

Answer 1
Answer:

Answer:

The outputs of the code is

2

0

2

Explanation:

First, I'll arrange the code line by line. While arranging the code, I'll make some corrections

#include <iostream>

using namespace std;

void doSomething();

int main(){

int x = 2;

cout << x <<endl;

doSomething(x);

cout << x << endl;

return 0;

}

void doSomething(int &num)

{

num = 0;

cout << num << endl;

}

At line 6, the value of x which is 2 is printed and the line is terminated to prevent printing of value on the same line. So, the next print statement will start on the next line.

At line 7, the function doSomething () is called.

This statement will execute the instructions in the doSomething () function and print value 0. This line is also terminated.

At line 8, the value of x is printed which is also 2


Related Questions

Computer design software requires __________________ to be used properly and successfully by architects.a. an understanding of details and construction b. an eye for design and a knowledge of computer programming c. a historical knowledge of architecture d. architectural talent and an eye for design
According to the Center for 21st Century Skills, what are three critical skills that modern employers look for in employees?A. Programming, presentations, and privileges B. Social media, status updates, and search expertise C. Fundamentals, frameworks, and finances D. Collaboration, communication, and creativity
Which of the following choices is not an operating system?A. DOS B. Windows Vista C. UNIX D. Windows 97
By working in a series of positions with increasing responsibilities, the owner of Stonegate Gardens has built her interest in flowers and plants into _____.
Which of following options opens a program, folder, document, or a Web site?a. All Programs b. Run c. Control Panel d. Start

The invention of the automobile contributed to the increase of urban sprawl. True or False

Answers

I feel that this is true. With the invention of the automobile citizens were able to start mobilizing and moving from place to place. This then started the process of urbanization and the expansion of multi million dollar corporations.

Answer:

true

Explanation:

Commercial websites have domain names so that users can easily access the web pages by typing the domain names instead of the IP addresses into the URL. All domain names must have four parts, regardless of where the websites are located. Each part is written as a set of octets and is separated by a period.

Answers

The given statement is true.

Explanation:

IP address is really tough to remember by each and everyone, and even if you misspell one number, then the navigation will not go for the desired website. It is equivalent to remember phone numbers during the earlier days. As said the domain name has 4 parts.

They are,  

  • TLD – Top level domain (eg: .com, .org, .net, etc).
  • Mid level domain – It is the part that comes after www keyword which is before the Top level domain name.
  • www is the machine name which is common for all the domain. It is a standard that needs to be used.
  • Second level domain.

If you must apply for a loan, you should _____. contact a broker and provide certain loan information visit a loan officer at a financial institution and complete an application call your credit card company and answer questions over the phone run a credit report and send it to a loan officer

Answers

B.) Visit a loan officer at a financial institution and complete an application.
Visit a loan officer at a financial institution and complete an application.

I just started jGrasp using java. For some reason, there isn't a toolbar with the run buttons compile buttons, etc. Does anyone know how to make them show up?

Answers

Go and use Eclipse or IntelliJ - it is free to use but much better and more stable.

HELLLLLPPPPP MMMMEEEEEER Alexander studies sitting on the edge of his bed with his laptop on his lap. He complains of a sore neck. How can he best improve his study area?He can put his computer on the bed and sit in a straight-backed chair.
He can sit in a comfortable chair and put the computer on his lap.
He can sit on the bed and put the computer on a nearby nightstand.
He can put his computer on a desk and sit in a comfortable chair.

Answers

Alexander complains of a sore neck. He can put his computer on a desk and sit in a comfortable chair. The correct option is D.

What are current sitting problems?

Long hours of sitting have been associated with several health issues, according to research. They include obesity and metabolic syndrome, a group of ailments marked by elevated blood pressure, excessive blood sugar, extra body fat around the waist, and dangerous cholesterol levels.

In particular in the lower back, "the mechanics of sitting increases muscle stiffness and pressure on the discs of the spine." "Slouching can put the spine's ligaments under undue strain, which can result in aberrant forces being applied to the lumbar joints and discs, creating pain.

Therefore, the correct option is D, He can put his computer on a desk and sit in a comfortable chair.

To learn more about health problems, refer to the link:

brainly.com/question/13026506

#SPJ6

Answer:

ITS D

Explanation:

Before donating a computer, you should use a program to wipe the hard disk to remove all of its data

Answers

If that's the case then it's a TRUE statement, because before donating a computer, you should use a program to wipe the hard disk drive to remove all of its data so no important data you had went to the wrong person.