import java.util.Scanner;
class faktorial
{
public static void main (String []args)
{
System.out.print ("Masukkan bilangan : ");
int angka = new Scanner (System.in).nextInt();
int total = angka;
for (int i=1; i {
total*=angka-i;
}
System.out.println ("\nFaktorial "+angka+" adalah "+total);
}
}
class faktorial
{
public static void main (String []args)
{
System.out.print ("Masukkan bilangan : ");
int angka = new Scanner (System.in).nextInt();
int total = angka;
for (int i=1; i
total*=angka-i;
}
System.out.println ("\nFaktorial "+angka+" adalah "+total);
}
}
Comments
Post a Comment