19
1
using System;
2
3
public class ForLoopProgram
4
{
5
public static void Main()
6
{
7
//this for loop is checked
8
for(int i=1;i<=3;i++)
9
{
10
//then this for loop is executed until condition is true
11
//on each outer for loop run, this is executed completed again
12
for(int j=1;j<=3;j++)
13
{
14
Console.WriteLine(i+" "+j);
15
}
16
Console.WriteLine("End of round "+i +" for outer loop");
17
}
18
}
19
}
Cached Result
1 1
1 2
1 3
End of round 1 for outer loop
2 1
2 2
2 3
End of round 2 for outer loop
3 1
3 2
3 3
End of round 3 for outer loop
1 2
1 3
End of round 1 for outer loop
2 1
2 2
2 3
End of round 2 for outer loop
3 1
3 2
3 3
End of round 3 for outer loop