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
VikaD [51]
3 years ago
12

What is the output of the following function call? //function body int factorial(int n) { int product=0; while(n > 0) { produ

ct = product * n; n❝; } return product; } //function call cout << factorial(4);
Computers and Technology
1 answer:
maks197457 [2]3 years ago
5 0

Answer:

zero

Explanation:

Because of the define the product variable is zero.

when the function call with pass by value 4.

The program control moves to that function, after that product

store the value zero. Then, product is multiply with n which become zero

because 0 * n is zero and store in the product again.

after that, n'' is wrong it must be 'n--' for performing the factorial function.

after that, the value of n is 3, again loop execute because condition n > 0

is true.

again zero multiply with n and become zero.

this process repeated until condition false and finally the output is zero.

Correction:

To make the code working:

change product = 1 instead of zero.

and change n-- in place of n''.  

You might be interested in
• The technical support department at your company has informed you that you will be receiving a new computer within the next we
alexdok [17]
1) back up your data
2) delete any personal information
3) clear cookies, browsing data, and saved passwords
4) restore any settings you may have changed to original settings
6 0
2 years ago
1. Which of the following is required to create a computer simulation?
Sonbull [250]
1. Data
2. Input
3. Experimentation
4. Calculates Physics
5. You owe me.
6. Do your work next time.
7. You will never be able to enjoy a nice pipe and gin and use an app like this like a trivia game if you don't force yourself to completely understand your work.
8. I sound like your dad.
9. I am right.
6 0
3 years ago
7.6 lesson practice edhesive
grigory [225]
There is a equal amount I guess free points for me
5 0
2 years ago
Read 2 more answers
Participants in open _________ community projects get experience and make connections with other professionals that can be valua
aleksandrvk [35]

Participants in open source community projects get experience and make connections with other professionals that can be valuable resources during a job hunt.

8 0
2 years ago
Kali, a python programmer is using the turtle module to write the word hello, which code should she use to indicate the location
natta225 [31]

Answer:

D. # pick up the turtle and move it to (-100,200)

Explanation:

goto() option lets the user to move to a particular location.

so, goto(-100, 200) picks up the turtle and moves to the starting location will be used to indicate location to begin writing the word.

7 0
2 years ago
Read 2 more answers
Other questions:
  • When inside a closed work environment, its okay to openly talk with co-workers about PII
    6·1 answer
  • I want to customize my company's logo, name, address, and similar details in all my business documents what option should use?
    12·1 answer
  • A university wants to install a client-server network. Which feature do you think is important for them as they set up the netwo
    7·1 answer
  • Who played a leading role in perfecting movable type for printing?
    15·1 answer
  • Technically
    12·1 answer
  • Which of the following is necessary to connect a computer outside of the hospital to the hospital's server?
    15·1 answer
  • URGENT!!! Steve wants to change shooting and exposure settings while on his photo shoot. Which camera part will allow him to do
    12·2 answers
  • Describe one practical application of total internal reflection. ​
    14·1 answer
  • A row-level trigger requires use of the _____ keywords and is executed once for each row affected by the triggering statement.
    7·1 answer
  • Write a function called mul_time that takes a Time_Elapsed object and a number and returns a new Time_Elapsed object that contai
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!