Var
i,jml:integer;
procedure TForm1.Button1Click(Sender: TObject);
var
data:integer;r:real;
begin
data:=strtoint(edit1.text);
jml:=jml+data;
i:=i+1;
r:=jml/i;
edit2.text:=floattostr(jml);
edit3.text:=floattostr(r);
end;
procedure.TForm1.Button2Click(Sender: TObject);
begin
Close;
end;
end.

Download Flie Lengkap Disini