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

What is the use of option explicit statement?

991


Mention what is variant in vbscript?

951


How strcomp function works?

1093


How to take whole text output from screen of Bitmap Application.

2376


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?

1402


There are 5 web pages.write a script to click the button on 4th web page.

3417


What are the data types supported by vbscript?

1128


What are class variables?

1041


How are values assigned to string type and numeric type variables?

1013


What is the main difference between function and sub-procedure?

1069


i need to sort the data using qtp script for this how i need to write a qtp script

3696


What is variant in vb script?

1166


How to declare an array in vbscript?

1338


Mention what is byref and byval parameters in vbscript?

1018


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

4420