Nested Loops
What is Nested Loop?
A loop inside another loop is called a nested loop.
Example
for(int i = 1; i <= 3; i++) {
for(int j = 1; j <= 3; j++) {
cout << “*”;
}
cout << endl;
}
for(int j = 1; j <= 3; j++) {
cout << “*”;
}
cout << endl;
}
Use Case
Patterns, matrices, grids
