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
PLEASE HELP!
ss7ja [257]

Explanation:

Case-sensitivity is inherently faster to parse (albeit only slightly) since it can compare character sequences directly without having to figure out which characters are equivalent to each other. It allows the implementer of a class/library to control how casing is used in the code.

3 0
3 years ago
PLEASE HELP! 25 POINTS!
irina [24]

Answer:

Its hard to answer unless im in the situation but id find a way to stop the car and figure out a way to get out and then call police

Explanation:

6 0
3 years ago
Read 2 more answers
How many conditions are needed in a while loop that should run until a user guesses the correct number or until they have made f
Sonja [21]
<h2>[] Hello! []</h2>

Answer:

2

Explanation:

MS Coding 1 A ED

---------------------------------------------------------------------------------------

  • I hope this helped
  • Brainilest appreciated!
7 0
3 years ago
If an attacker purchases and uses a URL that is similar in spelling and looks like a well-known website in order for the attacke
Mice21 [21]

Answer:

URL hijacking

Explanation:

Based on the information provided within the question it can be said that in this scenario they seem to be using an attack known as URL hijacking. This attack, also known as "typosquatting", is when someone takes advantage of individual's typos when searching for popular sites, in order to get them to go to their site which generates them money the more traffic they get.

5 0
4 years ago
What is mass storage? A. Storage that this is on-site B. Storage that this is off-site C. Storage that this is on-site AND off-s
KonstantinChe [14]

Answer:

The answer is "Option D".

Explanation:

Data storage requires different methods and tools to the dealing with the massive data volumes. It is distinct from only the storage, that relates to short term areas of data storage.

  • This system memory, even though the computer is switched off, external storage systems retain information.
  • In the sites storage, it uses the cookies to store sites data, that's why except option D all were wrong.

8 0
3 years ago
Other questions:
  • A user saves a password on a website the user logs into from a desktop. Under which circumstances will the password be saved on
    14·1 answer
  • Which of the following items is not considered a personal risk factor for ergonomic hazards? A. Body size B. Medical condition C
    6·2 answers
  • 2. A body is thrown vertically<br>100 m/s Theme taken to retum​
    13·1 answer
  • How many transponders are contained within a typical satellite?
    12·1 answer
  • A stateless firewall inspects each incoming packet to determine whether it belongs to a currently active connection.
    9·1 answer
  • What does an operating system do?
    12·1 answer
  • What is an assembler?
    11·1 answer
  • To print a budget:________.
    9·1 answer
  • If an ______ is caught dumping hazardous materials, that person can be prosecuted. Answer choices A) Employee B) Employer C) Bot
    7·1 answer
  • What is the difference between RELIABLE and UNRELIABLE sources of<br> income?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!