i think it was something like this, any mistakes sorry, i just tried to knock it up quick for u:
if (n <0) {
System.out.println("Error, negative number !");
System.exit(-1);
}
//check exit condition
if (n == 999) {
System.out.println("Exiting");
System.exit(1);
}
// Check for zero
if (n == 0) {
System.out.println("The factorial of zero is one.");
System.exit(-2);
}
// Compute
for ( count = 1; count <= n; count++) {
fact*= count;
}
// print result
System.out.println("The factorial of " + n + " is : " + fact + ".");
all u need to do is take in the user input from the command line with args[0] and check what the number is
__________________
"Never underestimate a dumb question"-- Brandon Boyd
|