Pascal program to find the average of numbers using WHILE DO structure andrey среда, 9 апреля 2014 г. No Comment

To calculate the sum and average of three different numbers. You can edit the loop and the average formula to repeat it as many times as you'd like.

Program untitled;
var
sum, ave, n : real;
i : integer;
begin
sum := 0;
i := 1;
while i <=3 do
begin
writeln ('enter your numbers');
readln (n);
sum := sum + n;
ave := sum / 3;
i := i + 1 ;
end;
writeln (ave);
readln;
end.

To calculate the sum and average of three different numbers. You can edit the loop and the average formula to repeat it as many times as you'd like.

Program untitled;
var
sum, ave, n : real;
i : integer;
begin
sum := 0;
i := 1;
while i <=3 do
begin
writeln ('enter your numbers');
readln (n);
sum := sum + n;
ave := sum / 3;
i := i + 1 ;
end;
writeln (ave);
readln;
end.

by Jillur Rahman

Jillur Rahman is a Web designers. He enjoys to make blogger templates. He always try to make modern and 3D looking Templates. You can by his templates from Themeforest.

Follow him @ Twitter | Facebook | Google Plus

No Comment