Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program cariRerata;
- uses crt;
- var
- x: array of integer;
- i, n, sum: integer;
- begin
- clrscr;
- write('Masukkan n: '); readln(n);
- setlength(x, n);
- sum := 0;
- for i:=1 to n do begin
- write('Bil ke-', i, ': '); readln(x[i-1]);
- sum := sum + x[i-1];
- end;
- writeln('Rerata: ', sum/n:0:2);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement