Write VB script to test given number is Prime Number

Answer Posted / kishore

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>3 Then
print "given numer is normal number"
else
print "given number is prime number"
End If

Is This Answer Correct ?    31 Yes 37 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

requirement is for combo box your expected value is str= "Denver.Frankfurt.London.Los Angeles.Paris.Portland.San Francisco.Seattle.Sydney.Zurich" you must get the text in combo box and need to compare them how

1594


UFT 12.02 which ALM version will support

1074


What is the difference between the design-time and run-time data tables?

641


How to execute the WR Script through QTP? I have WinRunner script with initialization script, common scripts, GUI AND functions. I connected WR through QTP with "call to WinRunner" option but I am getting problem after connecting to WinRunner i.e. showing "Do you want to quit now" with 'yes' and 'No' message box

1953


How can you send user defined messages to test report?

677






How to use setroproperty?

661


Name the properties you would use for identifying a browser and page when using descriptive programming?

637


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s. What is the difference between them? How to handle script issues?

658


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

1529


Hi, I'm a beginner in QTP and planning of a certification in QTP, but have no idea about it :P. Could anyone please tell me what certifications that a QTP- beginner can take? What is the fees and the syllabus for the certification? Please reply soon. Thanks Vidhya

1520


How will you compare keyword and expert view?

626


Hi All, I have QTP installed on my machine but the application under test (AUT) is on remote desktop.My scenarios is like that,it should contain following steps. 1)Automatically it should click on start and then on remote desktop connection. 2)it should enter the IP address and then connect to remote desktop. 3)and then it should be able to record the application in remote machine and then run it also. Can somebody tell me how to record the application which is in remote machine.

1598


When to use shared and local object repository?

731


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

681


What is checkpoints for quicktest professional (qtp)?

675