Source Code Java Rata - Rata
Mau buat nilai rata - rata pake SOftware Java ?
Langsung aja nih coding dibawah ini :
class Rerata {
public static void main(String[] args) {
double rata2;
double[] nilai={80,70,82,85,80,70,76};
rata2=(nilai[0]+nilai[1]+nilai[2]+nilai[3]+nilai[4]+nilai[5]+nilai[6])/7;
System.out.println("Nilai rata - rata = "+rata2);
}
}
Terima Kasih
Jangan Lupa Comment.
0 comments:
Post a Comment