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
Think of an example in your life where a number could be described as data, information, and knowledge
zhannawk [14.2K]

Answer:

how many event you have been too in the last month (well non during this time but as an example)

Explanation:

4 0
3 years ago
20 points for ez question lol
slega [8]
I think it might be the third on not certain
5 0
3 years ago
Read 2 more answers
On which tab can you find the margins button
insens350 [35]
In the tab key you alwAy use that to center
4 0
4 years ago
Read 2 more answers
It’s important to consider adjusting a user’s social network permissions (or access) because
Liula [17]
<span>You may not want to share access to social networks with other members of your team. Also you may want to adjust your users social permission for security reasons, just to be on the safe side. A stronger network means you have a lower chance of a hacker breaking through your system.</span>
5 0
3 years ago
The Event Viewer (Microsoft Windows) or Console (Apple Mac OS X) is used for what purpose?
Sveta_85 [38]

Answer:

to view incidents recorded in the Application, Security, and System logs

Explanation:

8 0
3 years ago
Other questions:
  • Data mining must usestatistics to analyze data.<br> True<br> False
    12·1 answer
  • A toolkit is:
    15·1 answer
  • Write a dialogue between two friends who are debating on popularity or property​
    6·1 answer
  • How to construct a speaking library presentation database. How will you use this library and database in the furture? Based on w
    10·1 answer
  • If a database was being used to track sales, a customer who buys a lot of items would be a good example of how two tables could
    14·1 answer
  • Which parts of the forebrain are sometimes described as the “executive center” and can be likened to the central processing unit
    9·1 answer
  • Match letters from column B to Column A by looking at the picture above.
    11·1 answer
  • Portable Document Format is a proprietary document file type created by Adobe Systems that is compatible with most computer syst
    7·1 answer
  • Which of the following statements is TRUE of a peer-to-peer network?
    10·1 answer
  • In an etl process, data is loaded into a final target database such as:______
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!