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
What purpose does ‘on error resume next’ serves?
What is the scope of a constant declared using public?
Mention what is the technology used by vb script?
regular expression that will recognize a browser as long as its name property starts with mybrowser
How should i Create Email invite with server-side Coding?
Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?
What is vbscript language used for and which earlier language is it modeled upon?
does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks
Explain the filter expression?
What is byref and byval parameters in vbscript?
How will you get the smallest subscript of an array in vbscript?
Explain the operator precedence in vb script?
In what way program "hello world" you can write in vbscript?
what is the use of QCUtil? explain with one example?
Is vbscript language a case-sensitive language and what does it mean?