Jumat, 19 April 2013
Posts by : Admin
Program Pascal Rata-rata Bilangan Menggunakan Array
Program array_rata_bilangan;
Uses wincrt;
Var
s:array [1..100] of 0..100;
n,i:integer;
rata2,jum:real;
Begin
Write('Banyaknya bilangan:');
Readln(n);
For i:=1 to n do
Begin
Clrscr;
Write('Bilangan ke',i,':');
Readln(s[i]);
End;
Clrscr;
Writeln('NO','BILANGAN':10);
For i:=1 to n do
Begin
Writeln(i,'.',s[i]:7);
Jum:=jum+s[i];
End;
Rata2:=jum/n;
Write('rata-rata :',rata2:2:2);
End.
Langganan:
Posting Komentar (Atom)
You can replace this text by going to "Layout" and then "Page Elements" section. Edit " About "
1 komentar:
kurang
Posting Komentar