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

Could Anybody tell me VBScript for
Check if a given number is Prime number-Don't use any Built-
in Functions Boolean/int is Prime(int number).. Thanks in
advance.

Answer Posted / ravi salunkhe

val=Inputbox("enter any number")
valprime=0
For i=2 to sqr(val)
If (val mod i)=0 Then
msgbox "not a prime number"
valprime=1
Exit for
End If
Next
If valprime=0 Then
msgbox "prime number"
End If

this will chop off the looping by limiting the loop to the
square root of the number!...\M/...mosh!

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain sga memory structures?

966


Can automation testing find ssame no. of bugs what we can find by manual testing?

1911


How will you get the natural logarithm of the given number in vbscript?

985


What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?

941


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

4341


what is the use of QCUtil? explain with one example?

6952


What are the data types supported by vbscript?

1043


PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com

2071


What is vbscript language used for and which earlier language is it modeled upon?

948


What are keywords in the vbscript language?

960


I want to run QTP script on Linux server is it possible to do this by connecting Windows to Linux through VPN/Terminal Server and just run the script on Linux server.

2232


Mention what is variant in vbscript?

897


How are values assigned to the variables in the vbscript language?

988


What is vbscript procedures?

1064


how to write a vb script in QTP for yahoo registration form, i want to check the performance also like performance test, stress, load test like that.

5154