jamesy961 jamesy961
  • 23-02-2017
  • Computers and Technology
contestada

I'm stuck on this problem and how do I test the program with the arguments.

Im stuck on this problem and how do I test the program with the arguments class=

Respuesta :

rsmith6559
rsmith6559 rsmith6559
  • 24-02-2017
The basic processing would be:

int factorial = 1;
while( N > 0 )
{
       factorial *= N;
       N--;
}

system.out.println( args[1] + "! is " + factorial );

It's kind of funny that the example run in your image has the wrong answer.
Answer Link

Otras preguntas

A retired marine is caught robbing a bank. Is this A.Civil law B.Constitution law C.Criminal law D.Military law
On March 1, 2021, a corporation has published a Notice of Redemption, calling all of its 6 1/2% Debentures, maturing in 2031. The corporation plans to refund th
Plz help due tomorrow
the change in altitude of a bird after 2 1/2 seconds was -41 1/4 feet. what was the average change in altitude of the bird in feet per secondPLEASE HELP​
Please answer this for me A B C D E
Which of the following is a partial reinforcement schedule that is most resistant to extinction?
Solve for in the equation |1 - 6 m/= 2.
How did sugar lead to Hawaii becoming one of the most diverse places in the world?
​​​​What type of resource is the sun and why? The sun is a perpetual resource because solar radiation steadily streams from the sun now, but it will only do so
Find and simplify an expression for the area of three rows of m squares with side lengths of m centimeters. Please help