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
What are the benefits of qtp?
I want to capture data(using keyword) from msdos application using QTP?... Below is little work i could do on it... /* Set app=CreateObject("Wscript.shell") SystemUtil.run ("C:\Users\Agent\Desktop\pumpsim\PUMPSIM.EXE") Window(“PUMPSIM.EXE”).Activate wait(3) app.sendkeys "N" */ Thanks in advance...!!!
How to associate shared object repository to test in qtp?
how u will evaluate the tool for test automation?
whenever U using QTP,Test Director, Why we using separate Bug tracking tool?
whare exactly we have to use functions and sub routain
if numbers are always changing write a script for that
How do we handle run-time errors?
Hi there, I've installed a trial version of QTP to see if it works with my product but I cant automate selecting windows from a tree view? Can anyone give me any pointers? Many Thanks
In QTP TEST DIRECTOR COMBINATION WHAT IS THE PURPOSE OF TEST DIRECTOR? In Somebody says to store test cases and design test cases.?ok fine , but In test director 5.0 , QTp not launching. what u do?
How to capture a window in QTP?
hi guys we r working in office...we write some scripts..suddenly we have a work(5min only) in out side..what will do now,,,used to system shut down or log off or lock or sleep mode,switch use or hibernate?
How many add-ins comes by default with qtp?
Which environments are supported by hp qtp?
what is the difference between modular framework & datadriven framework