meds...@gmail.com
unread,Jun 3, 2020, 3:28:20 PM6/3/20You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi David and Claudio:
Below is my FACTOR.PRG proggie compiled in both PellesC 9.0 and BCC 7.4, and the results of running both
Hope this helps.
-Mel
*********************************
Results from BCC 7.4 below
Factorial for nFac = 1 is: 1
Factorial for nFac = 2 is: 2
Factorial for nFac = 3 is: 6
Factorial for nFac = 4 is: 24
Factorial for nFac = 5 is: 120
Factorial for nFac = 6 is: 720
Factorial for nFac = 7 is: 5,040
Factorial for nFac = 8 is: 40,320
Factorial for nFac = 9 is: 362,880
Factorial for nFac = 10 is: 3,628,800
Factorial for nFac = 11 is: 39,916,800
Factorial for nFac = 12 is: 479,001,600
Factorial for nFac = 13 is: 6,227,020,800
Factorial for nFac = 14 is: 87,178,291,200
Factorial for nFac = 15 is: 1,307,674,368,000
Factorial for nFac = 16 is: 20,922,789,888,000
Factorial for nFac = 17 is: 355,687,428,096,000
Factorial for nFac = 18 is: 6,402,373,705,728,000
Factorial for nFac = 19 is: 121,645,100,408,832,000
Factorial for nFac = 20 is: 2,432,902,008,176,640,000
Factorial for nFac = 21 is: 51,090,942,171,709,440,000
Factorial for nFac = 22 is: -1
Factorial for nFac = 23 is: -1
Factorial for nFac = 24 is: -1
Factorial for nFac = 25 is: -1
Results from Pellesc 9.0 below
Factorial for nFac = 1 is: 1
Factorial for nFac = 2 is: 2
Factorial for nFac = 3 is: 6
Factorial for nFac = 4 is: 24
Factorial for nFac = 5 is: 120
Factorial for nFac = 6 is: 720
Factorial for nFac = 7 is: 5,040
Factorial for nFac = 8 is: 40,320
Factorial for nFac = 9 is: 362,880
Factorial for nFac = 10 is: 3,628,800
Factorial for nFac = 11 is: 39,916,800
Factorial for nFac = 12 is: 479,001,600
Factorial for nFac = 13 is: 6,227,020,800
Factorial for nFac = 14 is: 87,178,291,200
Factorial for nFac = 15 is: 1,307,674,368,000
Factorial for nFac = 16 is: 20,922,789,888,000
Factorial for nFac = 17 is: 355,687,428,096,000
Factorial for nFac = 18 is: 6,402,373,705,728,000
Factorial for nFac = 19 is: 121,645,100,408,832,000
Factorial for nFac = 20 is: 2,432,902,008,176,640,000
Factorial for nFac = 21 is: 51,090,942,171,709,430,000
Factorial for nFac = 22 is: -1
Factorial for nFac = 23 is: -1
Factorial for nFac = 24 is: -1
Factorial for nFac = 25 is: -1
The proggie that creatd the results above:
#define CRLF chr(13)+chr(10)
function Main()
// this program is built with PellesC64 and BCC 7.40 under xHarbour
local I, nFac
local cFactFile := "c:\cgi\FACTFILE.TXT"
local cFact,cFacts
cls
? "Computing Factorial for ever increasing numbers ..."
cFact := cFacts := ""
FOR I = 1 to 25
nFac := FACT(I)
cFact := " Factorial for nFac = "+TRANSFORM(I,"99")+" is: "+transform(nfac,"@Z 999,999,999,999,999,999,999,999")
? cFact
cFacts := cFacts + CRLF + cFACT
NEXT
cFacts := cFacts + CRLF
memowrit(cFactFile,cFacts)
? "Press Any Key to Finish."
inkey(0)
return NIL
***********************