1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
madreJ [45]
3 years ago
7

What is the output of the following program? #include using namespace std; void doSomething(int&); int main() { int x = 2; c

out << x << endl; doSomething(x); cout << x << endl; return 0; } void doSomething(int& num) { num = 0; cout << num << endl; }
Computers and Technology
1 answer:
Whitepunk [10]3 years ago
4 0

Answer:

The output will be as following:-

2

0

0

Explanation:

The function doSomething accepts the argument as reference.So whatever changes are made in the function to the argument the changes will be reflected onto the original arguments.

First the value of x is 2.Hence  2 is printed first.

Then function doSomething is called that changes the value of x from 2 to 0 and then prints it.Hence 0 is printed in the newline.

Then in the main function x is printed again the function changed it's value so 0 is printed.

You might be interested in
What are the trinity of the computer system
barxatty [35]

Answer:

I think the answers are input, processes, output

6 0
3 years ago
21
n200080 [17]

Answer:

slide sorter view

Explanation:

Explanation: while you can use 3/4 of these options to reorder slides, it is more common to use slide sorter view.

8 0
3 years ago
Select the true statement about the motherboard.
Nata [24]

Answer:

it executes the commands sent to it by the applica software .

8 0
3 years ago
Underinflated tires flex too much and build up heat, which can lead to tire blowouts.
ziro4ka [17]
Driving on under-inflated tires is very dangerous. If tires pressure is too low, too much of the tire's surface area touches the road, which increases friction. The more friction you have, the more heat is applied to the tires. Then, too much heat will make them overheat which can cause tread separation and, yes, blowouts. Therefore, the answer is true.
5 0
3 years ago
A poem for coduction
Nataly_w [17]
I don't know if you want a poem about conduction but if so here ya go

no matter how the heat
different temperatures meet
hot to cold how it's done
4 0
4 years ago
Read 2 more answers
Other questions:
  • Explain how the principles underlying agile methods lead to accelerated development and deployment of software.
    6·1 answer
  • Certain medications can increase risk of obtaining a sunburn true or false
    12·1 answer
  • A technician is configuring a new SOHO multifunction wireless router at a customer's location to provide network access to sever
    7·1 answer
  • When you start to type =av, what feature displays a list of functions and defined names?
    11·1 answer
  • #We've started a recursive function below called #measure_string that should take in one string parameter, #myStr, and returns i
    5·1 answer
  • Super easy question but you have to think about it because it’s not that easy I’ll mark brainliest for first answer Explain the
    11·1 answer
  • "The _____ of the Open Systems Interconnection (OSI) model generates the receiver’s address and ensures the integrity of message
    6·2 answers
  • If you set the Decimal Places property to 0 for a Price field, and then enter 750.25 in the field, what does Access display in t
    5·1 answer
  • Win10如何删除自己添加的环境变量?...............
    8·1 answer
  • Which tool uses images and other visual elements to provide artistic
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!