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

write a program to display configuration of a local system with the help of vb script.

1907


Which loop is used in case of arrays in the vbscript language?

726


Can automation testing find ssame no. of bugs what we can find by manual testing?

1735


How will you get the exponent of the given number in vbscript?

787


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

2088


How to get the length of the string by making use of the string function?

825


hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?

1984


wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......

1676


I need to get some data from data base and store this (retrieved) data in a excel sheet using VB script in QTP9.0 I have created connection for data base I have created as excels sheet by using Set XL=CreateObject("Excel.Application") XLworksheet.cells(1,1).value= rs.fields.item("<>") I have taken a for loop and changed the cells values (1 as i and another 1 as j) But still I am not able to get Plz kindly tell me know this . It is very urgent

1994


When does ‘on click of button’ event gets triggered in the vbscript language?

775


How are values assigned to the variables in the vbscript language?

782


How will you convert a given number to long in vbscript?

679


What are the different types of loops available in the vbscript language?

741


1.I want to establish connection with excel and also want to fetch the data using SQL queries. 2.the code should be written in such a way that in future if I want to migrate from excel to MS excess database , then there should be minimal changes.

1775


What are the rules to name variable in vbscript?

799