package Respon1;
import java.util.Scanner;
public class Respon_2 {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("Masukkan
bilangan pertama: ");
System.out.print("Masukkan
bilangan kedua: ");
int bil2 =
input.nextInt();
System.out.print("Masukkan
bilangan ketiga: ");
int bil3 =
input.nextInt();
System.out.print("Masukkan
bilangan keempat: ");
int bil4 =
input.nextInt();
System.out.print("Masukkan
bilangan kelima: ");
int bil5 =
input.nextInt();
System.out.print("Rata-rata: " +((bil1+bil2+bil3+bil4+bil5)/5));
}
}
Hasil:
0 komentar:
Posting Komentar