" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
PROGRAM Hitung;
VAR
sum, avg: Real;
i: Integer;
BEGIN
{ for X to Y do }
for i:= 1 to 5 do
BEGIN
sum := sum + i;
END;
avg := sum / 5;
{ WHILE DO }
while i <= 5 do
BEGIN
i := i + 1;
sum := sum + i;
END;
avg := sum / 5;
{ REPEAT UNTIL }
REPEAT
sum := sum + i;
i := i + 1;
UNTIL i = 5;
avg := sum / 5;
END.