Kullanıcıdan 3 not değeri alıp, bu notların ortalamasını hesapladıktan sonra ortalama 50 puanın altındaysa KALDI 50 ve üzerinde ise GEÇTİ yazdıran java programı
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | public static void main(String[] args) { int not1; int not2; int not3; int ort; System.out.println("Lutfen sinav notlarinizi giriniz:"); Scanner scanner = new Scanner(System.in); not1 = scanner.nextInt(); not2 = scanner.nextInt(); not3 = scanner.nextInt(); ort = (not1+not2+not3)/3; System.out.println(ort); if (ort<50) { System.out.println("KALDI"); } else { System.out.println("GEÇTİ"); } } |
Add Comment