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 / bhanu jay singh

<html>
<head>
<script language="vbscript" for="b1" event="onclick">
a=document.form.t1.value
for c=2 to a-1
if(a mod c)=0 then
x="no"
exit for
else
x="yes"
end if
next
if x="no" then
document.write("not a prime")
else
document.write("prime")
end if
</script>
</head>
<body>
<form name="form">
<input type="text" name="t1">
<input type="button" name="b1" value="find">
</form>
</body>
</html>

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What purpose does ‘on error resume next’ serves?

1020


What is the scope of a constant declared using public?

936


Mention what is the technology used by vb script?

931


regular expression that will recognize a browser as long as its name property starts with mybrowser

2195


How should i Create Email invite with server-side Coding?

2075


Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?

925


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

960


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

2870


Explain the filter expression?

1047


What is byref and byval parameters in vbscript?

1035


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

1324


Explain the operator precedence in vb script?

1025


In what way program "hello world" you can write in vbscript?

1077


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

6975


Is vbscript language a case-sensitive language and what does it mean?

975