![]() |
Prime number calculation - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: Prime number calculation (/Thread-Prime-number-calculation) |
Prime number calculation - aditya2304 - 12-07-2011 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 RE: Prime number calculation - sshukla12 - 12-07-2011 would you please elaborate your requirement. Regards, Sankalp RE: Prime number calculation - ravi.gajul - 12-07-2011 Try this Code: Dim arr() RE: Prime number calculation - aditya2304 - 12-13-2011 @ 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 RE: Prime number calculation - ravi.gajul - 12-13-2011 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. |