class FindFactorial
{
public static void main(String[] args)
{
if(ContainNumber.onlyNumbers(args[0])){
int number = Integer.parseInt(args[0]);
int result = 1;
while(number>0){
result = result*number;
number--;
}
System.out.println("Factorial of given number : " + result);
}
else{
System.out.println("Enter number is not positive integer");
}
}
}
Tuesday, August 18, 2009
Subscribe to:
Post Comments (Atom)
perfect, this one is almost good.. the only missing thing is already asked in another post.
ReplyDeleteI will give 9/10