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 / kanikira
a = cint(Inputbox("Enter a number to check whether it is a
prime number or not"))
count = 0
b = 1
Do while b<=a
if a mod b = 0 then
count = count +1
end if
b=b+1
Loop
If count = 2 Then
msgbox "The number "&a& " is a prime number"
Else
msgbox "The number "&a& " is not a prime number"
End if
| Is This Answer Correct ? | 12 Yes | 6 No |
Post New Answer View All Answers
Hi Friends my Question is very simple,in Manual testing when we click on a hyper link it directs us to the relavent page or it re-directs us to the current page,so there we can easily write testcase but same thing if we do in automation script using QTP & need to generate report using Reporter.report event how we will do it?thanks in advance...
Explain the functionality of vbscript?
who will create the object?
What is the difference between function and procedure?
what is diff between static and dynaic arrys?
We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?
What are the properties of regexp object?
Does VB/Win make standalone .EXE files?
How will you compare two strings in vbscript?
How to assign a date value to a variable?
HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.
Can automation testing find ssame no. of bugs what we can find by manual testing?
Like OPTION EXPLICIT statement what are the other statements used in vbscript and their usage. Please post me all the statements please.
What is the use of option explicit statement?
how to acces the remote mechine using vb cript(QTP)