For loop increments do not include

for(int i=0;i<=3;i++)
{
    for(int j=1;j<=2*i-1;j++)
        System.out.println(i);
}

The value of i after the first loop should be still 0, but it is incremented to 1. This is where I am not clear on the code. Can anyone explain this?


First Iteration

for(int i=0;i<=3;i++)  i = 0,true,
{
for(int j=1;j<=2*i-1;j++)    j=1 , j<=-1 which is false . so it is skipping
    System.out.println(i);  prints nothing
}

second Iteration

for(int i=0;i<=3;i++)  i = 1,true,
{
for(int j=1;j<=2*i-1;j++)    j=1 , j<=1 which is true. so now it runs loop inside
    System.out.println(i); so now prints 1
}

If you are a beginnerto loops. Always draw trace table dry runs