Not seeing a Scroll to Top Button? Go to our FAQ page for more info. [Java] Faktorial bilangan | -

My Imaginations

-
Follow Me

[Java] Faktorial bilangan



By  Galeh Fatma Eko Ardiansa     November 20, 2013     
Latihan buat Program java menghitung faktorial


import java.util.Scanner;
public class Latian1a {
      private static int faktorial(int x)
    {
     if (x ==1)
         return 1;
     else
         return (x * faktorial(x-1));
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int bil;
        System.out.println("masukkan angka : ");bil= in.nextInt();     
        System.out.println("Nilai faktorialnya adalah " +faktorial(bil));
    }   
}
   
caranya kosongkan form project netbeans
trus tinggal Copas aja sob...hehe..

smoga bermanfaat...:) aamiin

About Galeh Fatma Eko Ardiansa

If you can dream it, you can do it | Genius is one percent inspiration and ninety-nine percent perspiration | If you don’t make mistakes, you’re not working on hard enough problems | The best and most beautiful things in the world cannot be seen or even touched - they must be felt with the heart | I can't change the direction of the wind, but I can adjust my sails to always reach my destination.

Tidak ada komentar:

Posting Komentar


Formulir Kontak

Nama

Email *

Pesan *

Advertisement

Disqus Shortname