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
helppppp asap!!!!!!!!!! Sara has just started using the Internet. She would like to be a little more efficient. In 3–4 sentences
Artist 52 [7]
Use the web for educational purposes.
Use the web for instructional reasons.
Use the web only when something you find interesting does not make sense to you.
Don’t use the web on a day to day basis.
4 0
3 years ago
Read 2 more answers
manufacturers are making an effort to build energy-efficient computers and use recyclable cases and packaging true or false
Fittoniya [83]
True would be ur answer

Hope I helped:P
7 0
3 years ago
What describes a group of cells?<br> O crowd<br> Orange<br> O set<br> gangle
deff fn [24]

Answer:

A crowd because it makes more sense tho i could be wrong

7 0
2 years ago
Read 2 more answers
2. Because technology is always changing, there are new applications being developed constantly. (1 point)
Zepler [3.9K]
True because we need new tech
4 0
3 years ago
Read 2 more answers
The IPv4 address scheme has enough IP addresses to give every blade of glass in the world its own unique IP. True False
Andrew [12]

Answer:

False

Explanation:

IPv4 address are composed of four octets (8 bit numbers), ranging from <em>0.0.0.0 to 255.255.255.255</em>

All those 32 bits, in decimal notation, can form a total of

2^{32} = 4,294,967,296 different addresses.

Being more than 4 billion addresses and ignoring that some addressesare reserved for special uses, even present human population almost doubles that number.

So it is safe to state that IPv4 addresses is <u>not </u>enough to give every blade of grass its own IP.

8 0
2 years ago
Other questions:
  • A technician wants to create a new partition on a new additional hard drive. what tool should be used?
    15·1 answer
  • What does this say:<br> √ans
    6·2 answers
  • Approximately what percent of desktop PCs are used for work-related purposes?
    12·1 answer
  • Judy forgot where she saved a certain file on her computer. Therefore, she searches for all files with a .jpg file extension. Wh
    10·2 answers
  • Which of the following is not an example of technological progress? A: new scientific knowledge that has practical applications
    12·2 answers
  • So I’m doing a PowerPoint of how social media changed my life any ideas what I should right down and what kind of topics should
    11·2 answers
  • Which guideline should you use when downloading software from the Internet?
    15·1 answer
  • What are the three basic classes of application
    14·2 answers
  • Which one of the following items is an example of software?
    5·1 answer
  • What might a designer need to consider when choosing an appropriate energy source for products and power systems
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!