Ask coding questions

← Back to all posts
Nested Loop
DarkHollow (0)

for (int i = 1; i <= 5; i++) {
for (int z = 1; z <= i; z++) {
cout << "*";
}
cout << endl;
}

Output
*
**




The inner loop resets to 1 every time it performs?
Thank you!

Commentshotnewtop
vedprad1 (707)

What is the problem? What is your question? Could you be more clear to what you are asking?