Java cek umur

import java.util.Scanner;
public class cek_umur
{
 public static void main(String[] argumen){
 
 int umur = 0;
 
 Scanner s = new Scanner(System.in);
 System.out.print("masukkan umur : ");
 umur = s.nextInt();
 if(umur<0){
 System.out.print("belum lahir");
 }
 else if(umur>=0 && umur<1){
 System.out.print("bayi");
 }
 else if(umur>=1 && umur<17){
 System.out.print("anak-anak");
 }
 else if(umur>=17 && umur<25){
 System.out.print("remaja");
 }
 else if(umur>=25){
 System.out.print("dewasa");
 }
 
 
 }
}

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *