169k views
0 votes
I'm stuck on this problem and how do I test the program with the arguments.

I'm stuck on this problem and how do I test the program with the arguments.-example-1
User Tjassens
by
8.6k points

1 Answer

4 votes
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.
User Gissela
by
8.3k points