Write VB script to test given number is Prime Number

Answer Posted / vijay kumar

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

Next
If (count/2)<> 0 Then
print "given number is normal number"
else
print "given number is prime number"
End If

Is This Answer Correct ?    41 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does any one worked on JIL Emulator , Testing with QTP(automation). Trail Version of QTP is not identifying the child objects of JIL emulator, Can any one help me out ,

1380


Explain quicktest professional (qtp) testing process?

539


can u explain relative path architecture framework in qtp?

1563


Where should i find checkpoint and virtual objects's Object properties and values in the QTP 9.2 Means where checkpoints or virtual objects related data will store If i want to get the runtime object properties how can i use Getroproperties on Checkpoints

1462


What is difference between run time object and test object?

558






How to use parameterization in qtp?

624


please give me the code for doing retesting of gmail login page using functions so the function has to give the value

1546


Give the syntax to import/export xls into qtp.

588


In QA Testing when do you use Loadrunner vs QTP? What are the main differences between those two tools? Explain the purpose with real world scenario examples...In advance thank you!!!

2388


i am new QTP... please tell me automation frameworks , types & for whiich type of applications frameworks are used & how to generate script in keyword driven framework

1607


I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.

1587


What test cases can you automate using QTP?

648


How the exception handling can be done using quicktest professional (qtp)?

572


Can any one tell me.......How the test engg's start testing in the compy environment.....real time tester PLSSSS help me i need in depth information regarding this...

1493


To retrive the test data which tool vl use and whats basis u vl write test data? its urgent

1446