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
Explain the arrays in vb script?
Explain the scope of the variables using dim, public, and private keywords respectively.
Which operator can be used to do an xor operation in vbscript?
while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans
Why is the use of exit do or exit for statements within loops discouraged?
HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.
How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.
Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)
Explain the operator precedence in vb script?
Mention what are the rules to name variable in vbscript?
PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com
What are the disadvantages of vbscript?
Which in-built function related to an array joins substrings into one string in the vbscript language?
What is the difference between vbscript and vba?
Which in-built function is used to format the number in the vbscript language?