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
Why is error handling required?
How to write a VBscript for web page performance test i need a code send if any knows the code If any knows VBScript book plz send to me the link to my mail plz
Explain the string concatenation function in vbscript?
Can we create Crystal Report object in QTP?If yes then what it is and what are its various properties?
Which event is triggered when mouse focus comes out of an element in the vbscript language?
What are lbound and ubound in the vbscript language?
what is inner join? what is outer join? what is a constraint? tell me about rdbms? tell me about acid properties?
What is the use of option explicit in vbscript?
create a form to accept username and password validate the username and password with using message box, display the corresponding user message
Why is the use of exit do or exit for statements within loops discouraged?
I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?
Mention what is the difference between vbscript and vba?
In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?
Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder
Which in-built function related to an array joins substrings into one string in the vbscript language?