Lesson 6 of 24

Nested Loops: PatternsNested Loops: Patterns

9 min 30 XP

வெளி loop rows, உள் loop columns. string(n, '*') என்பது n stars கொண்ட string, patterns-ஐ எளிதாக்கும்.

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.

Challenge

+30 XP

n-ஐப் படித்து Floyd's triangle print செய்யுங்கள் (n = 4): 1 2 3 4 5 6 7 8 9 10

Read n and print Floyd's triangle (n = 4): 1 2 3 4 5 6 7 8 9 10

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.