Hi to all...
I've just join and found this amazing website/forum today which is very helpful.
So here's the problem.. I need to find the factorial of an input number, I have a slight problem with my script, when i enter a value which is 11 upwards it doesn't print the exact value what should i add or remove to my script..THANKS!
Here's my script:
import java.util.*;
public class factorial{
public static void main(String[] args) {
int z;
double b= 1;
Scanner x=new Scanner(System.in);
System.out.print("Enter Number : ");
z=x.nextInt();
System.out.println("Factorial : " +z+ ":");
for (int i=1 ; i<=z; i++){
b=b*i;
}
System.out.println(b);
}
}