Factorial Example : Java
import java.io.*;
class Factorial{
public static void main(String[] args) {
try{
BufferedReader object = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Number : ");
int a= Integer.parseInt(object.readLine());
int b= 1;
System.out.println("Factorial : " +a+ ":");
for (int i= 1; i<=a; i++){
b=b*i;
}
System.out.println(fact);
}
catch (Exception e){}
}
}
Subscribe to:
Post Comments (Atom)
1 comments:
Hello, Hem Rai!
I loved this post and this blog.
Have a nice day
Post a Comment