Considere o programa em Object Pascal listado abaixo:
uses SysUtils;
{$APPTYPE CONSOLE}
const
c = 5;
var
a: integer;
b, d: real;
function p1(c:integer):integer;
begin
if c=1 then exit;
result := c*p1(c-1);
end;
begin
a:= c;
b:= 4.0;
d:= 2;
writeln(intToStr(p1(a)), intToStr(a));
end.
A saída produzida pelo programa será: