Factorial1000 by *yuko*

program-id.a.data division.working-storage section.
1 i pic 999.
1 j pic 999 value 999.
1 k pic 9(6).
2 x pic 999 occurs 856.procedure division.add 1 to x(2).a.add 1 to i
compute k=k/1000+j*x(i)move k(4:)to x(i)if j=1
display x(857- i)no advancing.if i=856 move 0 to i
add -1to j.if j>0 go a.

Note that non-ascii characters in the above source code will be escaped (such as \x9f).


return to the top page