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 / lak
n=inputbox("Enter a Number to check whether the given
number is prime or not")
flag=1
for i=2 to n-1
if n mod i=0 then
flag=0
end if
next
if flag=1 then
msgbox "Prime"
else
msgbox "not prime"
end if
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
How to declare an array in vbscript?
what is the features of visual basic?
Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?
What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?
Mention what is the technology used by vb script?
How will you release the memory acquired by an array variable in vbscript?
how to comvert 120 into one hunderd twenty rupees only and vice varsa
Mention what are the rules to name variable in vbscript?
Write program for identifyig duplicates in flight Departing from and Arriving in mercury tours(web application).
How to open a file. What is the perpose of true and false mode there?
What are the advantages of vbscript?
PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com
if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.
Which loop is used in case of arrays in the vbscript language?
why do u choose to go for testing why cant for devoloping