BilgisayarKavramlari / Programlamaya-Giris

Her Dil için Programlamaya Giriş Antreman Soruları ve Çözümleri
517 stars 899 forks source link

Klavyeden 3 sayı okuyarak bu sayılardan en büyüğünü veya en küçüğünü ekrana yazan kodu yazınız. #561

Closed ttMech closed 5 years ago

Eldaniz85 commented 4 years ago

public class TSK_1 { public static void main(String[] args) { System.out.println("Birinci reqemi daxil edin: "); Scanner a=new Scanner(System.in); int numbers_1=a.nextInt(); System.out.println("Ikinci reqemi daxil edin:c"); Scanner b=new Scanner(System.in); int numbers_2=b.nextInt(); System.out.println("Ucuncu reqemi daxil edin:c"); Scanner c=new Scanner(System.in); int numbers_3=c.nextInt(); if(numbers_1<numbers_2&& numbers_1<numbers_3 && numbers_2<numbers_3 ) { System.out.println("En kick eded:" + numbers_1); System.out.println("En boyuk eded:" + numbers_3); }

if(numbers_2<numbers_1 && numbers_2<numbers_3 && numbers_1<numbers_3 ){ System.out.println("En kicik eded :"+numbers_2); System.out.println("En boyuk eded :"+numbers_3); }

if(numbers_3<numbers_1 && numbers_3<numbers_2 && numbers_1<numbers_2){ System.out.println("En kicik eded: "+numbers_3); System.out.println("En boyuk eded: "+numbers_2); } if(numbers_3<numbers_2 && numbers_3<numbers_1 && numbers_2<numbers_1); { System.out.println("En kicik eded: "+numbers_3); System.out.println("En boyuk eded: "+numbers_1); } }

}