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
When creating a shape in Word, what are some available options? Check all that apply. adding text to the shape changing the size
netineya [11]

Answer:

adding text to the shape

changing the size of the shape

changing the location of the shape

Explanation:

A word is can be regarded as graphical word processing program on the computer which can be used by users to type and to save documents. The word also has alot of useful tools with TABs such Insert, pagelayout, Design and others. It was developed by Microsoft corporation.

To create shapes in words, these step can be taken;

✓click "insert" at the interphase

✓Then look for "shapes" and select the needed shape.

✓To draw the shape, it should be clicked then drag holding the mouse.

✓after drawing, any modifications can be made, text can be added and lots more.

It should be noted that When creating a shape in Word, some of available options are;

✓adding text to the shape

✓changing the size of the shape

✓changing the location of the shape

8 0
3 years ago
An increase in the Money Supply will increase the Aggregate Price Level and will also increase which of the following?
Pavlova-9 [17]

your answer is b hope this helps


7 0
3 years ago
is defined as the condition in which all of the data in the database are consistent with the real-world events and conditions
-BARSIC- [3]

\boxed{Data \:anomaly} is defined as the condition in which all of the data in the database are consistent with the real-world events and conditions.

\red{\large\qquad \qquad \underline{ \pmb{{ \mathbb{ \maltese \: \: Mystique35}}}}}

3 0
3 years ago
Which describes the safest way to sit at a desk while typing on the computer?
Anna35 [415]

Answer:

Keep the knees and hips at 90-degree angles and the wrists straight.

Explanation:

From computer ergonomics, sitting at a desk and typing can affect the back, cause discomfort and sometimes injury. To protect the back, always sit with the knee and hips positioned at 90 degree while keeping the wrist straight and also position the equipment appropriately to always suite this posture.  

7 0
3 years ago
Martha is developing a software program in C++ and has a question about how to implement a particular feature. She performs an o
VLD [36.1K]

Answer:

A blog

Explanation:

A blog is a regularly updated website or web page, typically one run by an individual or small group, that is organised by posts.

7 0
3 years ago
Other questions:
  • Give the Linux bash pipelined command that would take the output of the "cat /etc/passwd" command (that lists the contents of th
    5·1 answer
  • You are working the 8:00 AM shift at the help desk. An irate user who fails to identify himself calls in claiming that his works
    7·1 answer
  • What will be displayed if code corresponding to the following pseudocode is executed? Set Number = 4 Repeat Write 2 * Number Set
    12·1 answer
  • Which of the following statements is the least abstraction of the world wide web?
    6·2 answers
  • A student that earns a well qualified score on an ap exam would receive a ___
    13·1 answer
  • Which do switches create?<br> Networks<br> Wireless access points<br> Routes<br> Collision domains
    5·1 answer
  • What will happen when you drag and drop a worksheet tab into another workbook WITHOUT holding the Ctrl key down?
    13·2 answers
  • In the U.S. fuel efficiency of cars is specified in miles per gallon (mpg). In Europe it is often expressed in liters per 100 km
    12·1 answer
  • How do i mark answers brainliest on brainly
    11·2 answers
  • Please help with question
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!