#include <stdio.h>
#include <stdlib.h>
int main(){
int i, j;
for (i=1; i<=3; i++){ /* This is the outer loop*/
printf("The start of the iteration %d \n", i);
for (j=1; j<=4; j++)
printf("iteration %d of the inner loop. \n", j)
printf("The end of the iteration %d of out loop \n", i)
}
return(0);
}
I dont understand how this code is suppose to run?
First i is = 1, it should print (Start of the iteration 1)
Then moves to j=1, it should print (Iteration 1 of inner loop)
Why does this repeat 4 times before printing (The end of the iteration 1 of out loop)?
Wouldn't the inner loop, loop these two lines 4 times?
printf("iteration %d of the inner loop. \n", j)
printf("The end of the iteration %d of out loop \n", i)