CJCoding With Joseph
15per day
← Back to Question List
C++ Code Walkthrough #16

Nested Loops Pattern

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