Factorial Program


Q Solution 1:  factorial:{prd 1+til x}

Q Solution 2:
n:5
do[-1+f:r:n;r*:f-:1]
r
120

The solution 2 is referred from Execution Control chapter in Q for Mortals.

Results :
factorial[5]
120

This entry was posted in Q and tagged , , . Bookmark the permalink.

1 Response to Factorial Program

Leave a comment