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
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
1 */ 1+til n