/**
* @author Ilham Yuliantoro Ilmu Komputer-UB
*/
import java.util.Scanner;
public class Rata_rata10 {
public static void main (String [] args){
Scanner input=new Scanner(System.in);
int jml=0;
float rata2=0;
for (int i=1;i<=10;i++){
System.out.print("Masukkan bil ke-"+i+": ");
int bil=input.nextInt();
jml=jml+bil;
}
rata2=jml/10;
System.out.print("Rata-rata 10 bilangan :"+rata2);
}
}
0 komentar:
Posting Komentar