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 / naga siva sankar

val=Inputbox("enter any number")valprime=0
For i=2 to Int(val/2)
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

Is This Answer Correct ?    37 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What's the difference between vbscript and vb.net?

1167


Which date function is used in the vbscript language to find the difference between the 2 dates?

1112


1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?

4065


How will you compare two strings in vbscript?

1126


please can you help me to get a code of flames using a visual basic 6

1855


What are the different types of operators and their order of precedence?

1087


while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans

2113


What are the differences between sub procedures and function procedures?

1035


How to replace junk code recorded by QTP with a mall function.

2131


Is vbscript a case-sensitive or case-insensitive?

1317


How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.

2187


did any one attended interview in applabs if you had gone through plz tell me the procedure

2311


where can i learn VB scripint ?

2161


Explain the arrays in vb script?

1104


Explain sga memory structures?

1080