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
How can you destroy an object in vbscript?
What are the advantages of vbscript?
please can you help me to get a code of flames using a visual basic 6
about vb scripting programs this type of all question& answers
Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?
How to pass argument by reference to a function in vbscript?
Why to use option explicit in vb script?
What are the valid scopes of a variable in vbscript?
How many types of operators are available in the vbscript language?
how to check whether link is disabled in QTP??
Explain the string concatenation function in vbscript?
hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?
I want to run QTP script on Linux server is it possible to do this by connecting Windows to Linux through VPN/Terminal Server and just run the script on Linux server.
give me any information abou vb script books learn quckly
Explain about the asc function?