Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

about vb scripting programs this type of all question& answers

2109


What are class properties?

1130


What is the difference between VBScript and JavaScript?

2654


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.

2268


Explain about filter expression?

958


How will you reverse a string in vbscript?

1094


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

4367


Which operator is used to concatenate the 2 values in the vbscript language?

985


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.

2064


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?

970


Out of the different type of operators, which are evaluated first and last in the vbscript language?

964


Which function allows you to instantiate an object given its programmatic identifier or progid?

1000


How to Import data from a file (file is on the desktop) to the data table

1966


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

1689


Explain about scrrun.dll?

920