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
Which Excel file extension stores automated steps for repetitive tasks?
Marianna [84]

Excel Macros, or .xlsm, stores automated steps for repetitive tasks.

4 0
3 years ago
Read 2 more answers
A typical day in programming and software development would involve
mrs_skeptik [129]

Answer:

writing code for a software program.

Explanation:

Software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications.

Some of the models used in the software development life cycle (SDLC) are; waterfall model, incremental model, spiral model, agile model, big bang model, and V-shaped model.

The five (5) standard stages of development in software development are;

I. Analysis.

II. Design.

III. Implementation (coding).

IV. Testing.

V. Maintenance.

A typical day in programming and software development would involve writing code for a software program.

Generally, software applications or programs require a code containing series of sequential instruction to perform specific tasks, commands and processes. These sets of code are typically written by a software developer (programmer).

3 0
3 years ago
The Accounting department is testing a new payroll system server. To facilitate their tests, they would like to add the server t
natka813 [3]

i am still 13  

udduudncd nd ndcdnnbdmbfvmd

4 0
3 years ago
8. Understanding the proper classification of a problem or fault
kati45 [8]

Answer:

a

Explanation:

because the trust need to know what was the problem in the first place

8 0
4 years ago
What is the difference between a database schema and a database state?
Alexxx [7]

Answer:

A database schema or an intention gives a description of the database. This can be considered as a blueprint of a database, and gives a list of fields in the database with their data types. ... A database state provides the present state of the database and its data.

8 0
3 years ago
Other questions:
  • A computer has a memory ________, rather than just a single memory component. The lowest level is some form of ________ storage
    11·1 answer
  • The counter variable in the code below increments by 1 each time through the loop. What will the value of counter be after the f
    11·1 answer
  • Which statement is true about the elements of the interface of a presentation program? The status bar appears at the top of the
    14·2 answers
  • How to connect a three way switch to a regilar switch?
    9·1 answer
  • For the questions below, consider a class called ChessPiece. This class has two instance data, String type and int player. The v
    13·1 answer
  • A debugging process where you, the programmer, pretend you are a computer and step through each statement while recording the va
    11·1 answer
  • An alteration threat violates information integrity. <br> a. True <br> b. False
    13·1 answer
  • A healthcare organization received notification that a hospital employee’s laptop that contained PHI was inadvertently left at a
    14·1 answer
  • Why do certain words change color in Python?
    6·1 answer
  • In what way , if any, can your social media presence affect your chances of getting a job in social media?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!