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.