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 are the 2 ways to pass a value to the function?
Which operator is used to concatenate the 2 values in the vbscript language?
Why is error handling required?
write a function to read the items from combobox of Flight reservation & save in excel (QTP)??
If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?
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 ?
How will you convert a given number to long in vbscript?
What are class properties?
Which in-built function related to an array joins substrings into one string in the vbscript language?
what is used of Property........End Property loop ? how to write the script for it?
What are the 2 ways in which a variable can be declared in the vbscript language?
Explain the arrays in vb script?
Explain about the extension .hta?
Hellow friends, I am learning QTP,but here problem is VB script. please guide me how to learn VB script w.r.t QTP and if you know any books tell me or if you have any materials or any use full material or any else w.r.t QTP please post me p.p.sekhar
what is the object hyrarchy in QTP for a web based application