Factorial Program In Vbscript Using For Loop

C++ Factorial Program For LoopJava Program For Factorial

Mar 03, 2015 Writing a Factorial with For Loops. C programming tutorial to find factorial using for loop. JavaScript Program to Print Factorial of a Number.

Here is an approach: Function MyFactorial(ByVal x As Integer) As Integer Dim temp As Integer Dim i As Integer if x = 0 then ' handle the odd case MyFactorial = 1 ' 0! = 1, math definition!!!! Exit Function End If temp = 1 ' not 0!!!!! For i = 1 To x temp = temp * i Next i MyFactorial = temp End Function That's it. I wasn't able to indent the code, sorry. Hope it helps, Gabriel * Sent from AltaVista Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful Thu, 06 Jun 2002 03:00:00 GMT.

>Here is an approach: >Function MyFactorial(ByVal x As Integer) As Integer >Dim temp As Integer >Dim i As Integer >if x = 0 then ' handle the odd case >MyFactorial = 1 ' 0! = 1, math definition!!!! >Exit Function >End If >temp = 1 ' not 0!!!!! >For i = 1 To x >temp = temp * i >Next i >MyFactorial = temp >End Function >That's it. I wasn't able to indent the code, sorry. >hope it helps, >Gabriel >* Sent from AltaVista Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful Thu, 06 Jun 2002 03:00:00 GMT.

>Here is an approach: >Function MyFactorial(ByVal x As Integer) As Integer >Dim temp As Integer >Dim i As Integer >if x = 0 then ' handle the odd case >MyFactorial = 1 ' 0! = 1, math definition!!!! >Exit Function >End If >temp = 1 ' not 0!!!!!

>For i = 1 To x >temp = temp * i >Next i >MyFactorial = temp >End Function >That's it. Max For Live Cracked Ableton For Mac. I wasn't able to indent the code, sorry. >hope it helps, >Gabriel >* Sent from AltaVista Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful --- WtrGate+ v0.93.p7 sn 153 * Origin: Fmlynet/Internet Gateway (8:8/2001) Thu, 06 Jun 2002 03:00:00 GMT. Here is an approach: Function MyFactorial(ByVal x As Integer) As Integer Dim temp As Integer Dim i As Integer if x = 0 then ' handle the odd case MyFactorial = 1 ' 0!

= 1, math definition!!!! Exit Function End If temp = 1 ' not 0!!!!! For i = 1 To x temp = temp * i Next i MyFactorial = temp End Function That's it. I wasn't able to indent the code, sorry. Hope it helps, Gabriel * Sent from AltaVista Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful Thu, 06 Jun 2002 03:00:00 GMT. >Here is an approach: >Function MyFactorial(ByVal x As Integer) As Integer >Dim temp As Integer >Dim i As Integer >if x = 0 then ' handle the odd case >MyFactorial = 1 ' 0!

= 1, math definition!!!! >Exit Function >End If >temp = 1 ' not 0!!!!! >For i = 1 To x >temp = temp * i >Next i >MyFactorial = temp >End Function >That's it.

I wasn't able to indent the code, sorry. >hope it helps, >Gabriel >* Sent from AltaVista Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful Thu, 06 Jun 2002 03:00:00 GMT.

>you could try >[Private Public] Function MyFactorial(intYourNum As Integer) >Dim intFactorial As Ineger >Dim i As Integer >' intYourNum = integer for factorial >i = 0 >intFactorial = 1 >For i = 0 To (intYourNum - 1) Step 1 >intFactorial = (intFactorial * (intYourNum - i)) >Next i >MyFactorial = intFactorial ' return value >End Function >trippz a little modification. Private Function MyFactorial(ByRef intYourNum As Byte) As Double Dim intFactorial As Double Dim i As Integer ' intYourNum = integer for factorial i = 0 intFactorial = 1 For i = 0 To (intYourNum - 2) Step 1 intFactorial = (intFactorial * (intYourNum - i)) Next i MyFactorial = intFactorial ' return value End Function this goes up to 170, any higher and you would need to change the data types trippz Fri, 07 Jun 2002 03:00:00 GMT Page 1 of 1 [ 10 post ].