Lesson 10 of 23

Nested Loops: Patterns

10 min 30 XP

బయటి loop rows ను, లోపలి loop ప్రతి row అక్షరాలను print చేస్తుంది. Campus tests కు pyramids, diamonds చాలా ఇష్టం.

Example: edit me and press Run

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

Pyramid లో row r కు (n - r) spaces, (2r - 1) stars ఉంటాయి. ముందు పట్టిక తయారుచేసి, తర్వాత loops రాయండి.

Challenge

+30 XP

n చదివి ఈ తలకిందుల త్రిభుజాన్ని print చేయండి (n = 4): **** *** ** *

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