RosettaCodeData/Task/Factorial/Pebble/factorial.pebble

31 lines
287 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
;Factorial example program for x86 DOS
;Compiles to 207 bytes com executable
program examples\fctrl
data
int f[1]
int n[0]
begin
echo "Factorial"
echo "Enter an integer: "
input [n]
label loop
[f] = [f] * [n]
-1 [n]
if [n] > 0 then loop
echo [f]
pause
kill
end