write a vb script to calculate factorial of a number?

Answer Posted / arvind singh

a = InputBox("Enter a no to calculate factorial for")
Result = 1
Do While a > 0
Result = Result*(a)
a = a-1
Loop
MsgBox Result

Is This Answer Correct ?    8 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the features of visual basic?

1558


Explain the constants in vbscript?

568


How are values assigned to string type and numeric type variables?

542


Explain about adodb.stream class?

595


i wrote vbscripit code in notepad i got error i am in learning stage if u ps tell me what wrong in my code my error is "object required descriptive at line one run time error"and my code is "set usernameobj=Descriptive.Create() usernameobj( "name").value="Username" set passwordobj=Descriptive.Create() passwordobj("name").value="password" set signinobj=Descriptive.Create() signinobj("name").value="sigin" browser("gmail").page("gmail").WebEdit("usernameobj").set ("enter username") Browser("gmail").Page("gmail").WebEdit("passwordobj").Set secure.Crypt.Encrypt("enter password") browser("gmail").page("gmail").WebButton("siginobj").click

1421






Is VB Script Case sensitive or Case insensitive?

640


Explain the extension .hta?

546


What is the purpose of the err object in the vbscript language?

630


Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?

1554


Like OPTION EXPLICIT statement what are the other statements used in vbscript and their usage. Please post me all the statements please.

1625


Can anyone send me a vb script function for verifying the functionality of active links on a web page

1602


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

873


Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP

1877


How to access array data?

545


How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.

2500