RosettaCodeData/Task/Factorial/GW-BASIC/factorial.basic
2023-07-01 13:44:08 -04:00

7 lines
151 B
Text

10 INPUT "Enter a non/negative integer: ", N
20 IF N < 0 THEN GOTO 10
30 F# = 1
40 IF N = 0 THEN PRINT F# : END
50 F# = F# * N
60 N = N - 1
70 GOTO 40