Solid Rhombus Pattern

Princy Prakash
May 25, 2023

--

ALGORITHM:

  1. Get the input for the number of rows n.
  2. Initialize two loops for rows and columns.
  3. Repeat the outer loop until i reaches n.
  4. Inside the outer loop, initialize j as n - i.
  5. Repeat the inner loop until j is less than n.
  6. Inside the inner loop, print two spaces (“ “) to create the indentation for each row.
  7. Repeat the inner loop until j reaches n.
  8. Inside the inner loop, print an asterisk (“*”) to create the rhombus shape.
  9. Move to the next line by creating a newline character.
  10. Increment j by 1.
  11. Increment i by 1.
  12. Repeat the outer loop until all rows are printed.

FLOWCHART:

--

--

Princy Prakash
Princy Prakash

Written by Princy Prakash

Hi I Am Princy. I recently discovered my passion for programming and excited to get deeper into the world of technologies also in problem-solving

No responses yet