Jumat, 15 November 2013

Program Kondisi Sederhana pada JAVA

 import java.util.*;
public class kondisi {

    public static void main(String[] args) {
  
        Scanner input = new Scanner(System.in);
        int a;
  
        System.out.print("Masukan angka : ");
        a = input.nextInt();
  
        if (a%2==0)
                 System.out.print("DE");
        if (a%4==0)
            System.out.print("JA");       
        if (a%8==0)
            System.out.print("VU");   
  
     System.out.println("\n\n");              
    }
      
}

0 komentar:

Posting Komentar

Please Leave Your Comment :)