Posts: 2
Threads: 1
Joined: Dec 2011
Reputation:
0
12-07-2011, 12:19 AM
Can anyone write the VB script code for QTP for the following problem -
Declare an array of size 4, increase its side to 7 and then find out which of the elements are prime numbers using functions
Posts: 426
Threads: 4
Joined: Aug 2011
Reputation:
0
12-07-2011, 11:56 AM
would you please elaborate your requirement.
Regards,
Sankalp
Posts: 2
Threads: 1
Joined: Dec 2011
Reputation:
0
12-13-2011, 09:22 PM
(This post was last modified: 12-13-2011, 09:26 PM by aditya2304.)
@ Ravi gajul
Thanks a lot ravi for ur solution ... this wil work fine but u haven't used functions...i want the same program to be coded using functions
@sankalp
I think the requirements are very clear..
A program needs to be coded using functions which have 7 elements(after increasing array size from 4 to 7) and then to find out which of the elements are prime out of the 7 elements.
If program is coded in such a manner that using functions it can find out all the prime numbers present in an array,,, then i think we can get a perfect program
Awaiting ur reply
Posts: 257
Threads: 10
Joined: Oct 2011
Reputation:
2
12-13-2011, 10:33 PM
Use the same code starting from for loop in the function and pass array(by ref) as the argument to the function.I thought you will do that.