/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Fak;
/**
*
* @author FIQI
*/
import java.util.Scanner;
public class Fak
{public static void main(String[] args){
int f=1;int n;
Scanner sc = new Scanner(System.in);
System.out.print("Masukkan Nilai Faktorial : ");
n=sc.nextInt();
{
for (int i=1;i<=n;i++) f*=i;// f*=1 adalah faktorial sama dengan
// dikalikan 1 dst, looping
System.out.println(n+"! = "+f);
}
}
}
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Fak;
/**
*
* @author FIQI
*/
import java.util.Scanner;
public class Fak
{public static void main(String[] args){
int f=1;int n;
Scanner sc = new Scanner(System.in);
System.out.print("Masukkan Nilai Faktorial : ");
n=sc.nextInt();
{
for (int i=1;i<=n;i++) f*=i;// f*=1 adalah faktorial sama dengan
// dikalikan 1 dst, looping
System.out.println(n+"! = "+f);
}
}
}
0 komentar:
Posting Komentar
: Ayoo sharingg.. :D