Write VB script to test given number is Prime Number

Answer Posted / prasanth

Dim n
count=0
n=inputbox("enter a number")
For i=2 to n-1
If n mod i=0Then
count=count+1
End If

Next
If count>1 Then
print "given numer is normal number"
else
print "given number is prime number"
End If

Is This Answer Correct ?    8 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

give me the code to save all messages of inbox of gmail into a folder and notepad

1626


How can we use the "CreateObject("Shell.Application")" in QTP and what is the definition and purpose of it?

3064


Give me At Least 5 Differences between DOCUMENTATION OBJECT MODEL(DOM)and COMPONENT OBJECT MODEL(COM)? Interviewer said me to WRITE the difference only in points not as you WRITE a paragraph ???? only in points

1637


Did QTP prove efficient for your project? Yes or No, explain?

6124


What contains Data Driven Framework document in qtp?

1473






hi, FOR 3+ QTP INTERVIEW, FOR EXAMPLE WE PUT ONLINE BANKING SYSTEM PROJECT IN OUR RESUME, IN PROJECT MANAGER ROUND...WHAT R THE MAJOR QUESTIONS ARE ASKED IN P.M? PLS TELL ME ATLEAST 10 QUESTIONS?.....AND IF POSSIBLE POST ANSWERS ALSO....

2443


Discuss the QTP Environment?

633


Explain the types of properties that quick test learns while recording?

566


What is the difference between QTP and WinRunner? Why do you choose only QTP for automation among remaing tools like Rational robot and silk test? Write the VBscript for any functionality in your project ? What is the cost of QTP ? If you entered into yahoo mail with your valid user name then you will get FOR EXAMPLE , " welcome to krishna " on the top of inbo page , how can you test it in QTP? What type of testing you can do, when we gave you 5 screens and how can you test that application? What type of framework you are using in your company and explain it?

1797


How to record application running on the Virtual machine?

644


What is quicktest professional (qtp window?

600


Hi All, issue is related to handling pop up script generated in IE, and run on mozilla. In App Under Test, when we get the alert pop ups, we just click ok button. if we need to run the same code on mozilla it will not identify . so we will check browser if browser(*).dialog(IE object).exits browser(*).dialog(IE object).winbutton(OK).click else 'by default mozilla browser(*).dialog(mozilla object).page(*).webbutton(OK).CLICK END IF But my qustion is. Do we write the above piece of code where ever we get such kind of pop ups from the application like alert pop up, confirmation pop up.... OR do we have any other alternative way to do this by using any functions in Recovery Scebarios? If Any of u know idea please do help me in this regard. or send answer to kravimb@gmail.com

1437


There is an built in window application in qtp9.1,i.e.Flight4.0.i want to implement the recovery maneger on it.How can i do this?

1631


What is the difference between the keyword view and expert view?

531


How you can find length of array in qtp?

551