Home » » Program Nilai Rata-rata

Program Nilai Rata-rata

Written By Unknown on Kamis, 29 Maret 2012 | 20.35

DESIGNED BY ANDRI MUCHSIN


program nilai_rata_rata;
uses wincrt;
type
larikint= array[1..20] of integer;
var
x : larikint;
n,jum,i : integer;
r : real;
function rata (x:larikint; n:integer):real;
begin
jum:=0;
for i := 1 to n do
begin
jum:= jum+i;
end;
rata:= jum/n;
end;
begin
write('Masukkan Banyak Data:');readln(n);
for i:=1 to n do
begin
write('Masukkan Data ke-',i,':');readln(x[i]);
end;
writeln('Maka Rata-rata Data tersebut adalah: ',rata(x,n):0:2);
end.


Share this article :

0 komentar:

Posting Komentar

Terimakasih Telah membaca artikel kami. Silahkan tinggalkan komentar anda disini.

 
Support : Dunia Matematika | Dunia Fisik dan Fiksi
Copyright © 2013. Blog Berbagi Ilmu - All Rights Reserved
Template Created by AM Published by Aeroplane
Proudly powered by Blogger