program rata rata

program rata_rata;
uses wincrt;

var
a, mahasiswa : integer;
nilai, total, tinggi, rendah, rata : real;
nama:string;

begin
total := 0;
write ('jumlah mahasiswa : '); readln (mahasiswa);
writeln;
for a := 1 to mahasiswa do

begin
write ('nama mahasiswa ke ',a,' ');readln (nama);
write ('nilai ',nama,' : '); readln (nilai);
total := total + nilai;
end;
rata := total / mahasiswa;
writeln ('rata-rata nilai mahasiswa : ',rata :1:2);
readln;
donewincrt
end.

Categories:

0 comments:

Post a Comment