procedure TForm1.Button1Click(Sender: TObject);
var
x:real;
i,n:integer;
begin n:=strtoint(edit1.Text);
if n = 0 then
begin edit2.Text:=’1′;
label4.Caption:=edit1.Text + ‘ !’;
end;
if n < 0 then begin
edit2.text:=’syntax error’;
label4.Caption:=edit1.Text + ‘ !’;
end;
if n > 0 then
begin
x:=1;
for i:=1 to n do
x:=x*i;
edit2.Text:=floattostr(x);
label4.Caption:=edit1.Text + ‘ !’;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Close;
end;
procedure.Form1.Button2Click(Sender: TObject);
begin
edit1.Text:=’ ‘;
edit2.Text:=’ ‘;
label4.Caption:=’ ‘;
end;
end.

download File Lengkap disini