Hi, Anybody could you Please tell me How to write the
script for Checking whether given number is Prime Number or
not..Thanks in Advance

Answer Posted / anwar basha

n=cint(inputbox("enter the number"))
if n=0 then
msgbox " invalid no"
end if

flag=0
for i=1 to n-1
if n mod i =0 then
falg=1
end if
exit for
next

if falg=1 then
msgbox "not a prime num"
else
msgbox "prime no"
end if

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Compare java script and vb script?

688


How to open a file. What is the perpose of true and false mode there?

704


Which function is used in the vbscript language to convert the specified expression into a date type value?

610


What are the environments supported by vbscript language?

587


Mention what are the rules to name variable in vbscript?

627






Can anyone send me a vb script function for verifying the functionality of active links on a web page

1668


create a form to accept username and password validate the username and password with using message box, display the corresponding user message

2267


What is select case statement?

697


how to write a vb script in QTP for yahoo registration form, i want to check the performance also like performance test, stress, load test like that.

4840


Hello Guys, If any body looking for "worksoft certify tool training in bangalore", please contact me aimansaud@gmail.com

1147


How to replace junk code recorded by QTP with a mall function.

1756


HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.

2145


after medical test,when will be the police verification

1805


Explain about the support of asp for vb script functionality?

613


What are class events?

661