You are viewing a single comment's thread. Return to all comments →
Here, we will use two for loops, outer for loop will print one row of star pattern ans second row will print space characters and # characters.
In any row, the sum of spaces and stars are equal to N. Number of stars increases by one and number of spaces before stars decreases by 1 in consecutive rows.
In any row R, we will first print N-R space characters then R star characters.