Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Factorial using arrays
#2
Without arrays it could be this. With arrays don't know.

Function Factorial
Code:
Copy      Help
;/
function'long long'n

;Factorial.

;EXAMPLE
;int i
;for i 0 21 ;;factorials of bigger numbers don't fit into the long type
,;out F"{i} {Factorial(i)}"


long r(1) i
for i 2 n+1
,r*i
ret r


Messages In This Thread
Factorial using arrays - by philipq - 07-06-2022, 09:20 AM
RE: Factorial using arrays - by Gintaras - 07-06-2022, 10:47 AM
RE: Factorial using arrays - by philipq - 07-06-2022, 10:53 AM
RE: Factorial using arrays - by philipq - 07-06-2022, 01:36 PM
RE: Factorial using arrays - by Gintaras - 07-06-2022, 03:30 PM
RE: Factorial using arrays - by Gintaras - 07-06-2022, 03:39 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)