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
about vb scripting programs this type of all question& answers
What are class properties?
What is the difference between VBScript and JavaScript?
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.
Explain about filter expression?
How will you reverse a string in vbscript?
How to Convert Hex color code to color name in VB Script?
Which operator is used to concatenate the 2 values in the vbscript language?
Hi Friends Rajendra this is bhavani prasad, iam working Hyderabad. i faced one problem with qtp recording mode i.e in my application there is 100 records first we click the first record that record will be jumped to next session and 99 records will there stop the recording and run the same script .Run this script qtp does not identify the records. So plz tell me what is the solution.
Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?
Out of the different type of operators, which are evaluated first and last in the vbscript language?
Which function allows you to instantiate an object given its programmatic identifier or progid?
How to Import data from a file (file is on the desktop) to the data table
Dear All, I am geting below IE error whilie executing the QTP scripts in Batch mode "Internet Explorer has encountered a problem and needs to close. We are sorry for the inconvenience." can any one suggest me how to resolve this issue . Thanks Balaji
Explain about scrrun.dll?