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 / kanikira

a = cint(Inputbox("Enter a number to check whether it is a
prime number or not"))
count = 0
b = 1
Do while b<=a
if a mod b = 0 then
count = count +1
end if
b=b+1
Loop
If count = 2 Then
msgbox "The number "&a& " is a prime number"
Else
msgbox "The number "&a& " is not a prime number"
End if

Is This Answer Correct ?    12 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql loader? Explain the files used by sql loader to load file?

1213


What is the purpose of the err object in the vbscript language?

1159


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

3731


If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?

2105


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

1087


how to automatically update the sql server2005 database records when insert in vb6?

1998


Explain the tristate constants in vbscript?

1079


why do u choose to go for testing why cant for devoloping

2112


How will you get the largest subscript of an array in vbscript?

1217


What is the use of the recordset object and which statement is used to create such an object?

1007


does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks

2990


A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.

1998


How to write VB script for login module?

3233


Mention what is the technology used by vb script?

1014


How are arrays declared in the vbscript language?

1046