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

What is a data driven test in qtp?

576


What is the architecture of your project? Can any one answer for this question plz........

1406


How can you write the scripts that operate on different objects depending on run-time information?

2108


How to run a test using quicktest professional?

525


Explain the new feature of UFT regarding the export of test results?

571






Can you brief the hurdles you faced during Automation testing?

573


What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?

690


If I am scripting Web-based Surveys using QTP that open up differently but at the exact same point require a username and password can I automate that username and password for all the surveys some how using QTP?

1425


What are the different types of recording modes?

527


What is the basic concept of quicktest professional?

526


How many types of parameters are available in quicktest professional?

514


What is the file extension of the code file and object repository file in QTP?

589


When you open QTP, how many sheets you can see?

648


assume i have few url link how will i dynamically call then using descriptive programming?

1593


In application which areas to be automated and what kind of situation will be take? using QTP? Plz give me the clear answer

1931