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...

Hi, Anybody could you Please tell me How to write the
script for Checking whether given number is Prime Number or
not..Thanks in Advance

Answer Posted / pankaj jaju

Function IsPrime(Num)
Dim varNum, varCtr, varLimit
varLimit = Round(Num/2)

For varCtr = 2 To varLimit
varNum = Num Mod varCtr

If varNum = 0 Then
IsPrime = False
Exit For
End If
Next

If varCtr >= varLimit Then
IsPrime = True
End If
End Function

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?

1004


How do i automate a website www.flyashx.com without having any test cases witin a week time.

1913


What is the purpose of drive object of scripting.filesystemobject class in vbscript?

1007


Which operator can be used to change the value of the operand or change the state of the condition?

1029


What is the difference between a dictionary and an array?

1062


What is the difference between function and procedure?

1213


Explain the asc function?

935


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

3101


How to assign a date value to a variable?

1095


what is the differance between BYVAL,BYREF?

2262


Mention how to assign a date value to a variable?

1084


What is the purpose of on error resume next statement?

992


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

2256


Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?

1290


1.I want to establish connection with excel and also want to fetch the data using SQL queries. 2.the code should be written in such a way that in future if I want to migrate from excel to MS excess database , then there should be minimal changes.

1999