![]() |
Odd and Even Number Puzzle aka FizzBuzz - 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: UFT / QTP Interview Questions (https://www.learnqtp.com/forums/Forum-UFT-QTP-Interview-Questions) +--- Thread: Odd and Even Number Puzzle aka FizzBuzz (/Thread-Odd-and-Even-Number-Puzzle-aka-FizzBuzz) |
Odd and Even Number Puzzle aka FizzBuzz - Varshin - 08-08-2015 Please solve this program! If a number is even means, should print as even number else should print in the below pattern Suppose the given number is 3, the output should be as below * * * * * * * * * RE: Odd and Even Number Puzzle aka FizzBuzz - Ankur - 08-09-2015 This is a variation of Fizz Buzz puzzle usually asked in programming interviews. Here is one of the approach that can be used to solve this question. There can be many ways to arrive at the solution. It will be interesting to see how other QTP forum members approach this question.
PHP Code: Dim strPattern, iNumber RE: Odd and Even Number Puzzle aka FizzBuzz - Varshin - 08-10-2015 Thanks Ankur for ur prompt reply. RE: Odd and Even Number Puzzle aka FizzBuzz - kotaramamohana - 08-10-2015 I have modified second For Loop little bit Code: Dim strPattern, iNumber Hi Ankur, I have come up with one more logic is below Code: Dim strPattern, iNumber |