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

Which operator can be used to do an xor operation in vbscript?

1262


If else for do while select in vb script?

1172


Explain sga memory structures?

1037


can anyone send me a vb scripts code for clicking on a link and coming back on home page again does the same for many links on a web page.

2301


write a program to display configuration of a local system with the help of vb script.

2130


What is the use of option explicit statement?

990


how to set one column as primary key in QTP and fetch values accordingly

2326


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

1046


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

1968


how to acces the remote mechine using vb cript(QTP)

2038


Explain few date functions in vbscript?

1072


how to operate webobjects in a webpage using getobject function and then using generic methods?

3119


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

4420


What are the special sub-types in vbscript?

1061


What are events in the vbscript language?

1124