/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package faktorial;
import javax.swing.*;
/**
*
* @author Angga
*/
public class faktorial {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String faktorial = “”;
System.out.println(“Menghitung Faktorial”);
System.out.println(“——————–“);
do {
faktorial = JOptionPane.showInputDialog(“Faktorial dari : “);
int f=Integer.parseInt(faktorial);
int fak=1;
for(int i=1;i<=f;i++)
fak *=i;
System.out.println ("Faktorialnya dari "+f+" = "+fak);
}
while (true);
}
}