GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

Pattern Printing with one loop only

I have this pattern. The task is to get it printed using only one loop. How to do it? Only way I can think of it is to use a goto statement to simulate the inner loop but I don't think that's right. Moreover our main objective through this is to be able to write less complex and more precise code.


    *   *

  *   *   *

    *   *


asked Jun 7, 2016 by Nitangle