Please sign in to comment.
factorial sample, WIP
- Loading branch information...
Showing with 45 additions and 7 deletions.
|@@ -0,0 +1,19 @@|
|+perform show-factorial varying n from 1 to 10.|
|+show-factorial locals result.|
|+perform factorial using n giving result.|
|+display n "! = " result.|
|+factorial using n locals m.|
|+if n = 1 then return n.|
|+subtract 1 from n giving m.|
|+perform factorial using m giving m.|
|+multiply n by m.|