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

Will there be any standards or requirements for page appearance and/or graphics throughout a site or parts of a site?

596


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

1468


How to Test the mainframe application?

1816


What are the ways you can synchronize?

577


Where to use Property Let, Property Get, Property Set in UFT

368






Dear Friends, I having total 3+year experience in manual testing including automation testing QTP, if i am attending any interview what kind of question will i get? please help me out

1574


How to upload excel files into Quality Center using QTP Script and how to delete excel files from Quality?

606


Mention what are the different types of recording modes in qtp? Which will be used when?

555


what is impact analysis on regression testing?

2036


What is Port testing. Whhen will you perform?

1489


In qtp, how you can exit for loop?

519


Hi All, I need code for how to execute qtp scripts from excell sheet

1455


What is synchronization point in QTP?

668


In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.

1521


How to create a standard checkpoint ?

550