/**
* Copyright (c) 2010 Alvin Aditya H
* GNU GPL License
*/
PROGRAM "GABUNGAN_MAX_DAN_RATA_RATA"
VAR
A : ARRAY [1..10] OF INTEGER;
I,J,K,MAX : integer;
TOTAL : INTEGER;
RATA2 : REAL;
Begin
FOR I := 1 TO 10 DO
begin
write('masukkan angka ',I,'= ');
READ(A[I]);
end;
MAX := A[1];
write('MAX = ');
FOR J := 2 TO 10 DO
IF MAX <= A[J] THEN MAX := A[J];
WRITELN(MAX);
Total := 0;
FOR K := 1 TO 10 DO TOTAL := TOTAL + A[K];
RATA2 := TOTAL / 10;
WRITELN('rata-rata= ',RATA2);
End.
READ MORE - Coding Pascal - GABUNGAN_MAX_DAN_RATA_RATA
* Copyright (c) 2010 Alvin Aditya H
* GNU GPL License
*/
PROGRAM "GABUNGAN_MAX_DAN_RATA_RATA"
VAR
A : ARRAY [1..10] OF INTEGER;
I,J,K,MAX : integer;
TOTAL : INTEGER;
RATA2 : REAL;
Begin
FOR I := 1 TO 10 DO
begin
write('masukkan angka ',I,'= ');
READ(A[I]);
end;
MAX := A[1];
write('MAX = ');
FOR J := 2 TO 10 DO
IF MAX <= A[J] THEN MAX := A[J];
WRITELN(MAX);
Total := 0;
FOR K := 1 TO 10 DO TOTAL := TOTAL + A[K];
RATA2 := TOTAL / 10;
WRITELN('rata-rata= ',RATA2);
End.