program CalculateFactorial;varn, i: integer;factorial: integer;beginwrite('Enter a non-negative integer: ');readln(n);
factorial := 1;for i := 1 to n dobeginfactorial := factorial * i;end;
writeln(n, '! = ', factorial);end.
program CalculateFactorial;
var
n, i: integer;
factorial: integer;
begin
write('Enter a non-negative integer: ');
readln(n);
factorial := 1;
for i := 1 to n do
begin
factorial := factorial * i;
end;
writeln(n, '! = ', factorial);
end.