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

n=inputbox("enter the number")
count=0
for i= 1 to n
if n mod i=o Then
count=count+1
Endif
Next
if count=2 Then
Msgbox "number is prime"
Else
Msgbox "number is not prime"
Endif

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which function is used to perform string comparison?

1125


How to access array data?

1003


Out of the different type of operators, which are evaluated first and last in the vbscript language?

1005


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

2347


What is the output of a + b in vbscript if a = 5 and b = 10?

3112


Mention how to access array data?

1003


who will create the object?

2198


Mention the rules for using option explicit statement?

996


How will you convert a string to lower case string using vbscript?

1019


What is event handling in vbscript?

1103


Hi this is Vinoth. I need a help on below mentioned question A combobox contains list of items assume as 5 I have to get each items Individually and I have to Export to datatable. Please help me on this. Thanks

2131


Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?

1013


what is diff between static and dynaic arrys?

2157


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

1298


What is the use of the formatdatetime function in the vbscript language?

1023