CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Nested Loops Pattern

C++ code walkthrough · Question 16
mediumLoops

Code

Read carefully. What does this print?
1#include <iostream>
2using namespace std;
3 
4int main() {
5 for (int i = 1; i <= 3; i++) {
6 for (int j = 1; j <= i; j++) {
7 cout << "*";
8 }
9 cout << endl;
10 }
11 return 0;
12}

Your answer