RosettaCodeData/Task/Factorial/GW-BASIC/factorial.basic

8 lines
151 B
Plaintext

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