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

Explain about datafile/verification of date file when file is not available in local system?

2220


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?

1624


1 Folders in VSS 2 In navigation script there are 100 script i want to run first 50 and 37th script also not needed to run how to do this 3 What is navigation script,Driver script, business script what we are loaded in this script 4 use of resource tab 5 Difference between verification and validation give real scenario example 6 file scripting object when to use it 7 what are the problems you are faced while testing web application 8 difference between expert view and keyword view 9 difference between QTP 8.2 and QTP 9.2 navigation frame work please answer these questions from real time working people as early as possible

1608


Get the count of files of similar types from a folder.

970


Can anyone pls tell me how to do action parameterization (input and output parameters) with respect to login window and insert order of flight reservation window in detail( pls give a clear step by step explanation with example) anyone please. Will be very thankful to u

1373






What is Test Fusion Report in QTP?

614


Hi Friends, Would be great if you can provide the Model Question paper, Web site link or any reference s. Thanks & Regards, Byzoor,

1342


How to use conditional loops in qtp ?

585


How many types of recording facility are available in quicktest professional?

562


how will you check how many members visited the website www.infosys.com?

1476


Explain types of descriptive programming?

589


How will you report the bug and explain the defect tracking sheet you handled?

2547


Hi Friends this is kumar i would like to request to all of you ,please help me to explain real time project with using qtp scripts i know basics of qtp but it won't workout on interviews,pls help awating to reply.

1367


Explain different types of action in qtp?

571


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

1460