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
Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.
1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?
What is the event handling in vbscript?
How to access array data?
How are comments handled in the vbscript language?
How do i automate a website www.flyashx.com without having any test cases witin a week time.
If else for do while select in vb script?
What if you do not specify anything when you call a procedure?
how to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me
What are the rules to name variable in vbscript?
Can we create Crystal Report object in QTP?If yes then what it is and what are its various properties?
Explain about the asc function?
hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?
What are the environments supported by vbscript language?
What is the purpose of drive object of scripting.filesystemobject class in vbscript?