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

What is the value of the expression when a = 5 and b = 2? 2a + b – 3 A. 24 B. 11 C. 9 D. 6
when annotating a visual work, one must think about what occurs after the image was captured. what is this called? a. identify author's argument b. infer beyo
"All men having power ought to be mistrusted."—James Madison Imagine you are a representative to a state legislature meeting, debating the proposed Constitution
How do I solve 10p+5=18p-6/2
Which of the following gases are typically used for colorful lighting when an electric current is apllied
Someone please help me using the Order of Operations:BracketsExponentsDivisionMultiplicationAdditionSubtraction
Why do wolves howl at the moon?
The Mughal Empire was established by: A.) Akbar B.) Babur C.) Ali D.) Fatima
You work 40 hours/week for 52 weeks and are given the option to be paid hourly or to go on salary. In which situation will you earn the most? $30,000/year $15.
How fast can the average human run?