write a vb script to calculate factorial of a number?
Answer Posted / raja
Dim n,f
n=inputbox("enter a number")
f=1
If n<0 Then
msgbox "invalid number"
else if n=0 or n=1 then
msgbox "the factorial of given number is : "& f
else
For i=1 to n
f=f*i
Next
msgbox "the factorial of given number is : "&f
End If
end if
| Is This Answer Correct ? | 77 Yes | 19 No |
Post New Answer View All Answers
What is the use of option explicit statement?
Mention what is variant in vbscript?
How strcomp function works?
How to take whole text output from screen of Bitmap Application.
I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?
There are 5 web pages.write a script to click the button on 4th web page.
What are the data types supported by vbscript?
What are class variables?
How are values assigned to string type and numeric type variables?
What is the main difference between function and sub-procedure?
i need to sort the data using qtp script for this how i need to write a qtp script
What is variant in vb script?
How to declare an array in vbscript?
Mention what is byref and byval parameters in vbscript?
How to Convert Hex color code to color name in VB Script?