a)
*Hàm
function giaithua(n:integer):longint;
var i:integer;
begin
giaithua:=1;
for i:=1 to n do
giaithua:=giaithua*i;
end;
b)
*Hàm
function max(a,b:integer):integer;
begin
max:=a;
if max<b then max:=b;
end;
c)
*Thủ tục
procedure hoandoi(a,b:integer);
var tam:integer;
begin
begin
tam:=a;
a:=b;
b:=tam;
end;
end;