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

who will create the object?

1719


How to write functions and sub in vb script?

620


If else for do while select in vb script?

638


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.

1831


please can you help me to get a code of flames using a visual basic 6

1226






What is the difference between function and procedure?

567


What is the use of the formatdatetime function in the vbscript language?

549


What is select case statement?

598


Explain about operator precedence in vb script?

575


What are string functions in vbscript?

652


What is the use of the recordset object and which statement is used to create such an object?

527


What is difference between vbscript and vba?

606


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

538


Mention characteristics of sub procedures?

576


Hi Friends my Question is very simple,in Manual testing when we click on a hyper link it directs us to the relavent page or it re-directs us to the current page,so there we can easily write testcase but same thing if we do in automation script using QTP & need to generate report using Reporter.report event how we will do it?thanks in advance...

1651