Skip to content

Commit 2ff54d8

Browse files
author
Svetlin Nakov
committed
Updates Content/Chapter-6-1-nested-loops/nested-loops/example-triangle-of-dollars.md
Auto commit by GitBook Editor
1 parent 5ac2038 commit 2ff54d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Content/Chapter-6-1-nested-loops/nested-loops/example-triangle-of-dollars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Watch this video to learn how to print a triangle of dollars on the console, usi
1212

1313
## Hints and Guidelines
1414

15-
The problem is **similar** to those for drawing **a rectangle** and **square**. Once again, we will use **nested loops**, but there is **a catch** here. The difference is that **the number of columns** that we need to print depends on **the row**, on which we are and not on the input number **`n`**. From the example input and output data we see that **the count of dollars depends** on which **row** we are on at the moment of the printing, i.e. 1 dollar means first row, 3 dollars mean third row and so on. Let's see the following example in details. We see that **the variable** of **the nested** loop is connected with the variable of **the outer** one. This way our program prints the desired triangle.
15+
The problem is **similar** to those for drawing **a rectangle** and **square**. Once again, we will use **nested loops**, but there is **a catch** here. The difference is that **the number of columns** that we need to print depends on **the row**, on which we are and not on the input number **`n`**. From the example input and output data we see that **the count of dollars depends** on which **row** we are on at the moment of the printing, i.e. 1 dollar means first row, 3 dollars mean third row and so on. Let's see the following example in detail. We see that **the variable** of **the nested** loop is connected with the variable of **the outer** one. This way our program prints the desired triangle.
1616

1717
![](/assets/chapter-6-images/04.Triangle-of-dollars-01.png)
1818

0 commit comments

Comments
 (0)