Inverted Right-Angled Triangle Pattern With Asterisks
May 25, 2023
ALGORITHM:
- Get the input value
n
, which represents the number of rows in the inverted triangle pattern. - Start an outer loop to iterate over each row,
i
from 0 ton
. - Start an inner loop to iterate over each column,
j
from 0 ton-i
. - Inside the inner loop, print an asterisk (“*”).
- After the inner loop completes, create a new line or move to the next row.
- Repeat steps 3 to 5 until all rows and columns of the inverted triangle pattern are printed.
FLOWCHART: