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
tangare [24]
4 years ago
8

Below is a recursive implementation of the factorial function. For what value of n will this function not produce the desired re

sult? What will the function do in that case? public static int factorial(int n) { if (n == 0) return 1; else return n * factorial(n-1); }
Computers and Technology
1 answer:
kompoz [17]4 years ago
3 0

Answer:

Check the explanation

Explanation:

Here the data type we are making use of is int. Now when this function is being called for finding factorial of 13 or numbers that are greater than 13 then the function is expected to shows error and the desired result will not be produced.

Reason for this problem is-- range of int dat type is -2,147,483,648 to 2,147,483,647 . Now factorial of 12 is 47,90,01,600 which is less than 2,147,483,647 . But factorial of 13 is 6,22,70,20,800‬ which is greater than 2,147,483,647 which means int data type can not hold such large variable. That’s why it will not give desired result for value of n greater than 12.

Now you might just want to ask that what will function do in that case – the afct ins that different languages do different things in case of overflows. Some languages just say that data type can not handle . take for instance, when it comes to java warning about overflow is not there. And during overflow there it will show negative numbers.

You might be interested in
Because we live in a digital age and our presentations may be available for viewing for years to come, we have to be careful of
Rus_ich [418]

Answer:

presentation

Explanation:

Based on the scenario being described within the question it can be said that we have to be careful of our presentation so we do not date ourselves too badly. Presentation refers to the way we look, dress, and act. Such as the clothes and accessories we wear, the way we style our hair, etc. All done in order to look our best to others.

3 0
4 years ago
Read 2 more answers
What is a potential benefit of using a VPN? Select one: a. You could increase your level of privacy by guarding your real IP add
Alik [6]

Answer:

d. All of these.

Explanation:

A VPN is an acronym for Virtual Private Network and it's a secured, encrypted and private web-based service used for accessing region-restricted and censored internet content. A VPN protects web data from potential hackers and government surveillance by hiding the real IP address of the host and encrypting user's internet traffic.

Basically, the VPN is a computer software that enables internet users to create a secured connection (sends and receives data) over public or shared networks like they're directly connected to the private network.

The potential benefits of a VPN service are;

- It increases privacy level by guarding the real IP address on the Internet.

- It protects user data exchange on a public Wi-Fi network by encryption.

- It can be used to securely connect to a corporate or personal network from far away through the Internet and access local resources.

8 0
4 years ago
If a linux installation ends abnormally and the screen displays a fatal signal 11 error, what type of error has occurred?
artcher [175]
The installation would have crashed or failed
6 0
4 years ago
. Service recovery refers to A. the ability to quickly restore service following a service failure and provide compensation. B.
san4es73 [151]

Answer:

A. the ability to quickly restore service following a service failure and provide compensation.

Explanation:

Systems like servers are bound to fail at some point. This is because, it either has running parts or electronic components that could overheat or get shorted due to external or internal malfunction.

The ability of system to quickly restore services and operation after it experiences a total system failure is called system recovery.

7 0
3 years ago
if the bleeding period of a woman is indicated by days of 1-5, then the days when the woman is highly fertile is between______,s
Lana71 [14]

Drink the blood because it taste like candy and juice.

8 0
3 years ago
Other questions:
  • Reading is the process of transferring data, instructions, and information from memory to a storage medium.
    15·1 answer
  • How long does the Splunk search job remain active
    5·1 answer
  • 4.2 Code Practice: Question 1
    14·1 answer
  • Which storyboard component is a pictorial summary of how web pages in a website will connect with one another?
    12·1 answer
  • What is an example of a use for an icon set?
    6·1 answer
  • If a computer truncatesall numbers to two decimal places, compute the error forthe following: 23.345+222.34911)0.12)0.01413)0.14
    15·1 answer
  • Write a complete method from the client perspective that duplicates each element in place in a ListInterface object. For example
    8·1 answer
  • One example of a <br> is the length of a car.
    7·1 answer
  • jelaskan tiga kemungkinan sebab pengasah pensil itu tidak dapat berfungsi secara tiba-tiba (translate: explain three possible re
    7·1 answer
  • Create a timeline of the evolution of computers and their impact on society
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!