the inner loop will be executed 10 times for each iteration of the outer loop so this inner loop will get executed for 50 times in this program.
when i =1 the control enters the outer loop and control flows to the inner loop,
now j=1 and it satisfies the condition j<=10 so will enter the inner loop
now this will print
1
then j will get incremented and j will be 2 still satisfying the condition j<=10
and prints
2
now the line looks like
1 2
this goes on till j<=10 is false that is when j is 11 the inner loop will stop executing
and control flows to the next print statement that prints a new line
then i gets incremented to 2 and the same thing happens till i <=5 is false that is when
i becomes 6 the loop stops.