Lesson 6 of 24
Nested Loops: Patterns
9 min 30 XP
The outer loop handles rows, the inner loop columns. string(n, '*') builds a string of n stars, which makes patterns easy.
Example: edit me and press Run
Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.