Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a vb script to calculate factorial of a number?

Answer Posted / rik mondal

The answer submitted by "mudaseer" is absolutely wrong and
the answer by "raja" is partially correct(because he did not
wrote additional HTML and script tags,which is difficult to
understand for beginners). Guys don't you check the answer
before posting?
anyways here is the correct answer. This will work 100%.
Just copy it and paste in you editor then save and compile
by IE.


<html>
<script language="vbscript">
n=inputbox("Enter a number")
dim f
f=1
if n<0 then
Msgbox "Invalid number"
elseif n=0 or n=1 then
MsgBox "The factorial of given number "&n&" is :"&f
else
for i=n to 2 step -1
f=f*i
next
MsgBox "The factorial of given number "&n&" is :"&f
end if
</script>
</html>

Is This Answer Correct ?    41 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?

958


Explain the arrays in vb script?

1050


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

2335


How will you convert a string to upper case string using vbscript?

996


Explain about the extension .hta?

1060


Which operator is used to perform the comparison among 2 operands in the vbscript language?

947


What's the difference between vbscript and vb.net?

1098


What is the purpose of drive object of scripting.filesystemobject class in vbscript?

1001


How to write VB script for login module?

3179


What are class variables?

1024


Explain about adodb.stream class?

1112


can anyone send me a vb scripts code for clicking on a link and coming back on home page again does the same for many links on a web page.

2292


Which operator is used to concatenate the 2 values in the vbscript language?

1003


Mention what is select case statement?

947


Explain about scrrun.dll?

950