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
can anyone tell me the procedure of interview held in applabs
Which constant is used for print and display functions and works as same as pressing enter key?
How to create a cookie using vbscript?
hi i am trying for testing job for 3+ experience(fake) can u suggest me what type of projects i can keep in my resume and how much of knoeledge i should have abt that project.thnks in advance.urgt plz
i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me
What is the extension of the vbscript file?
What's the difference between vbscript and vb.net?
Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)
Out of the different type of operators, which are evaluated first and last in the vbscript language?
How to take whole text output from screen of Bitmap Application.
How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'
Explain the scope of the variables using dim, public, and private keywords respectively.
what is used of Property........End Property loop ? how to write the script for it?
If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?
How will you get a combined string from array of string in vbscript?