CJCoding With Joseph
← Back to Question List
C# Code Walkthrough #20

Nested Loop Iteration Count

mediumLoops

📄 Code

Read carefully — what does this print?
1int count = 0;
2for (int i = 0; i < 3; i++)
3{
4 for (int j = 0; j < 2; j++)
5 {
6 count++;
7 }
8}
9Console.WriteLine(count);

🎯 Your Answer