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 / vinay vuppala
1st method
dim a
dim b
b=1
count=0
a=inputbox("enter a number")
for b=1 to a
if((a mod b)=0) then
count=count+1
end if
next
if count>2 then
msgbox("the number "& a &" is a not prime number")
else
msgbox("the number "& a &" is a prime")
end if
| Is This Answer Correct ? | 17 Yes | 6 No |
Post New Answer View All Answers
Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.
What purpose does ‘on error resume next’ serves?
Mention what is vbscript procedures?
Which event is triggered when mouse focus comes out of an element in the vbscript language?
Explain a few date functions in vbscript
hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?
does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks
Mention the rules for using option explicit statement?
In what way program "hello world" you can write in vbscript?
What is the purpose of on error resume next statement?
What is the use of the instr function?
Like OPTION EXPLICIT statement what are the other statements used in vbscript and their usage. Please post me all the statements please.
How will you get a random number between 0 and 1 in vbscript?
What is loose binding? Why is it not a good practice to use it?
Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?