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
muminat
3 years ago
13

Given the following function definition

Computers and Technology
1 answer:
siniylev [52]3 years ago
3 0

Answer:

B. 1 6 3

Explanation:

Given function definition for calc:

void calc (int a, int& b)

{

int c;

c = a + 2;

a = a * 3;

b = c + a;

}

Function invocation:

x = 1;

y = 2;

z = 3;

calc(x, y);

cout << x << " " << y << " " << z << endl;

  • Since x is passed by value, its value remains 1.
  • y is passed by reference to the function calc(x,y);

Tracing the function execution:

c=3

a=3

b=c+a = 6;

But b actually corresponds to y. So y=6 after function call.

  • Since z is not involved in function call, its value remain 3.

So output: 1 6 3

You might be interested in
What is a characteristic ofa good cloud-based hosting?
Aliun [14]

Answer:

Explanation:

A good cloud-based hosting has many beneficial characteristics, some of which include on-demand self-service, broad network access, and being very elastic and scalable. These characteristics allow for a large number of users to benefit from the service at any time of the day and at a very fast speed due to the broad network access.

6 0
3 years ago
A type of authentication that requires the user to provide something that they know, such
bagirrra123 [75]
The answer would be true
5 0
3 years ago
Explain why it is important to always plug your computer into a surge protector.
Feliz [49]
A surge protector is designed to protect electrical devices from voltage spikes. It limits the voltage supplied by blocking or shorting to ground any unwanted voltages above a safe threshold.  
3 0
3 years ago
Do you think computers will be smarter than humans?
Andreas93 [3]

Answer: Yes, when we type something in, the computer will show you lots of things that a human can't think of. What i'm saying is, a computer thinks faster than a human.

Explanation:

8 0
3 years ago
Read 2 more answers
Brainly app won't let me watch ads anymore. I search my question and there is no skip button to watch an ad it only makes me buy
Nat2105 [25]

Answer:

Not sure it's doing the same thing for me to.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • During the processing stage what does the computer do
    12·1 answer
  • Alan wants to find an image of a car he can use in a presentation. What button should he click in the Images group to run a sear
    5·1 answer
  • A small company has developed a specialized software product that it configures specially for each customer. New customers usual
    14·1 answer
  • Which computer tools allow you to communicate with coworkers, family,and friends
    8·1 answer
  • Katherine wants to open a bank account that allowed her to perform frequent transactions without being charged a penalty and she
    14·1 answer
  • Pass only _____ at a time.
    13·2 answers
  • How can I change my username here at brainly?
    13·2 answers
  • To celebrate me reaching expert in the same day i made the account im doing a point giveaway
    12·2 answers
  • Match the term to the correct definition.
    6·1 answer
  • TensorFlow and Pytorch are examples of which type of machine learning platform?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!