Could you please share the approach that we should be taking for star question

Kindly share the approach that we should be using for star question

Hey @bhavikak, for this question we take an integer input as n.

Now we should do work for n rows, with the help of for loop.

Assuming row numbers in 0 based indexing, means first row has i =0 and second row has i = 1 and so on.

For every row we need to do two tasks.

  1. For ith row print numbers from 1 to (n-i)
  2. For ith row print (2*i -1) stars. (P.s. for 0th row value will be -1 so don’t print any stars).

Also print(’*’, end= ’ '), by default print prints every thing in new line, but here it will not shift to next line.
You need to use it as well.
Hope this resolved your doubt.
Plz mark it as resolved in my doubts section.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.