import java.util.Scanner;
public class fak_Husnaa{
public static void main(String[]args)throws Exception {
int i,j, k=1;
System.out.println("\n====FAKTORIAL====");
System.out.println("Masukkan Angka : ");
Scanner angka = new Scanner(System.in);
j= angka.nextInt();
System.out.print("\n"+j + " != ");
for(i=j; i>=1; i--){
System.out.print(i);
if(i>1)
System.out.print(" x ");
k=k*i;}
System.out.print("\n"+j+" != " +k+"\n");
}
}
selamat mencoba :)
0 terbaik