program aray; uses wincrt; TYPE nilai = array[1..3] of integer; Var x : integer; jumlah, rata_rata : real; a : nilai; BEGIN for x := 1 TO 3 DO BEGIN WRITE('Nilai Ke - ',x,' = '); READLN(a[x]); jumlah := jumlah + a[x]; END; WRITELN(''); WRITELN('Nilai Mahasiswa Ke 1 = ',a[1]); WRITELN('Nilai Mahasiswa Ke 2 = ',a[2]); WRITELN('Nilai Mahasiswa Ke 3 = ',a[3]); rata_rata := jumlah/3; WRITELN('Rata - Rata nya adalah ', rata_rata:0:2); readln; end.
No comments:
Post a Comment