Blogger

Senin, 18 November 2013

Scrirpt Untuk Menampilkan Nilai Terkecil Menggunakan Eclipse



package Respon1;

public class Respon_3 {
            public static void main(String[] args){
            int a=46;
            int b=47;
            int c=28;
            int l=7;
            int i=25;
            int d;
           
            System.out.println("Number 1 = "+a);
            System.out.println("Number 2 = "+b);
            System.out.println("Number 3 = "+c);
            System.out.println("Number 4 = "+l);
            System.out.println("Number 5 = "+i);
            if( l<b){
                  d=l;
            }else if(l<c){
                  d=l;
            }else if(l<i){
                  d=l;
            }else if(l<b){
                  d=l;
            }else if(i<a){
                  d=i;
            }else if(i<c){
                  d=i;
            }else if(i<b){
                  d=i;
            }else if(i<l){
                  d=i;
            }else {
                  d=c;
            }
            System.out.println("nilai minimum adalah angka = "+d);
      }

}






Hasil:

0 komentar:

Posting Komentar