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
5. A Disk defragmenter tool does what to a computer HDD?
Ivenika [448]

Answer:It rearranges the files on a hard drive to get quicker access to them.

5 0
2 years ago
What landforms are likely to form at this boundary
Paha777 [63]
<span>Landforms that could be created at convergent boundaries would consist of: volcanoes, mountains, trenches, volcanic islands, and even deserts could result from effects of converging boundaries. The landforms are mountains.</span>
3 0
3 years ago
Why is it important to think about the programming language to use?
Sloan [31]
In think is C or B in my opinion
6 0
3 years ago
What are the factors that influence the selection of access control software and/ or hardware? Discuss all aspects of access con
skelet666 [1.2K]

Answer:

While selecting the access control system (software or hardware), there are many factors that influence it and those factors are campus location, network capabilities, number of users using it, size of campus, the motive for using it, etc.

Explanation:

The access control system is electronic device that needs to be connected to the network for providing security control and authorization to the user to enter into the Campus.  

Access control systems are used to control access into premises or any IT area which is control in two ways either in a physical way or a logical way.

8 0
3 years ago
Each type of text has a purpose for the reader if you were looking to research penguins what type of text would u utilize
dlinn [17]
1. ughhhh not entirely sure but B, 2. again not entirely sure should be B as well and finally 3.is D remember these are not always the answer just most likely what one person thinks
3 0
3 years ago
Other questions:
  • Which of the following accurately completes this sentence? The Internet is ____.
    6·2 answers
  • While working on a forty-slide PowerPoint presentation, a user needs to quickly look over the six slides that have orange backgr
    10·1 answer
  • What are the requirements of a data dictionary ?
    7·2 answers
  • The more resources you have to choose from during an open book test, the better you will do on the test because more
    13·1 answer
  • Refer to the exhibit. If a hacker on the outside network sends an IP packet with source address 172.30.1.50, destination address
    11·1 answer
  • Ned and Mary Ann are saving their files to a CD. When prompted, Ned will click on Burn file to disk, indicate the recording spee
    15·1 answer
  • Assuming that the user enters 45 and 62 as inputs for n1 and n2, respectively, what is the output of the following code snippet?
    15·1 answer
  • Jackson has completed remediation of a virus-infected system. He eliminated all the startup program issues and uninstalled sever
    8·1 answer
  • Does access provide email communication
    13·1 answer
  • What goals do you set for yourself while studying?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!