write a vb script to display factorial of a number using
function

Answer Posted / mudaseer

sub fact(pnum)
dim vf
vf=1
for i=2 to pnum
vf=vf*i
next
msgbox vf
end sub
call fact(0)
call fact(3)

Is This Answer Correct ?    4 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what do you mean .ota mobile format

1945


how to operate webobjects in a webpage using getobject function and then using generic methods?

2545


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?

864


How to Convert Hex color code to color name in VB Script?

3934


Explain about arrays in vb script?

608






who will create the object?

1722


Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?

486


what is the difference between modular and data and keyword driven framework

1743


How can the spaces from the string be removed?

593


How can you create a file object to work with the files in the vbscript language?

511


What are the disadvantages of vbscript?

656


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

563


Mention how to access array data?

514


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 ?

1554


Explain about operator precedence in vb script?

577