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

3pied=12pie whata the awnser
In the English colonies in the 1600’s the role of Africans shifted from that of indentured servants to slave for life because
What limited the power of the English monarchy and established the precedent that the English government would be based on law?
Convert. If necessary, round to the nearest tenth. (Recall: 1.06 qt. ≈ 1 L) 15 L qt. a. 15.9 c. 13.4 b. 159 d. 134
Which sentence best shows correct comma usage? a. Mexico, has a lot in common with the United States, the country to its north. b. Mexico, has a lot in common
A material that can be hit without shattering is? viscous, flammable, hard, malleable
What is the product of 4 2/3 and 11 1/4? a. 44 2/12 b. 8 3/7 c. 56/135 d. 52 1/2
Which of the following best describes why women should avoid drinking alcohol when pregnant? a. Alcohol use should be avoided during pregnancy because whatever
What factor united the various groups of people in the Byzantine Empire?
The sum of two numbers is 5.036. one number has a 4 in the tenths place and 7 in the thousandths place. The other number has a 1 in the ones place and an 2 in t