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
If you were infiltrating a network (10.16.0.0/16), and searching for vulnerabilities (while trying to remain undetected), why wo
Juliette [100K]

Answer:

Yes, if you want to be undetected.

Explanation:

It is vital to always use a command that will ensure that one's activity is undetected. This is one of the important rules of corporate organizations to keep their data and activities safe and secure. The commend provided is a useful tool for detective works especially the activities of criminals and hackers. Therefore, if the admin wants to be undetected, the command should not be used.

8 0
2 years ago
Read 2 more answers
A national tax preparation firm is accessing industry-specific productivity applications in the cloud; many other tax preparatio
Andreas93 [3]

Answer:

software as a service(SaaS) model

Explanation:

This is because the software applications are accessed over the internet meaning no need for infrastructure installation and maintenance.

8 0
3 years ago
When copying and pasting text, the first step is _____.
Paul [167]

Answer:

type the,yext is the first step

4 0
3 years ago
Read 2 more answers
Mobile devices have their own OSs, tailored to their handheld needs, which means they are not immune to what?
NikAS [45]

Answer:

Malware

Explanation:

Malware is used in many types of software included handheld OS's

6 0
2 years ago
Desktop publishing design tools are represented by
alina1380 [7]

<span>A. icons.
B. windows.
C. trackballs.
D. modems.</span>

Desktop publishing design tools are represented by <span>icons. The answer is letter A. This is the easiest way to access the design tools when in need.</span>

5 0
3 years ago
Other questions:
  • Basic rule for java languague
    13·2 answers
  • darren wants to substitute every occurence of the word bulky in his spreadsheet with the word strong. which of these options sho
    9·2 answers
  • If K is a foreign key in relation R1, then
    10·1 answer
  • What is thhe name of service included with windows server operating systemthat manages a centralized database containing user ac
    5·1 answer
  • In theory, a(n) _____ can be an independent centralized database management system with proper interfaces to support remote acce
    15·1 answer
  • Which tab on the Chart Tools Contextual tab will contain commands that are used to change the style of charts and to edit chart
    12·2 answers
  • Programmers should strive to _____. increase coupling increase cohesion both of the above neither a nor b
    7·1 answer
  • The __________ operator increases the value of the variable by 1 after the original value is used in the expression in which the
    7·1 answer
  • Derek has to create a technical design of a complex floor plan using CAD. What will be most helpful for Derek to use to create t
    8·1 answer
  • If you notice that a worksheet displays columns A, B, C, E, and F, what happened to column D?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!