Hi!
As an exercise I would like to turn following nested for loop into a nested while loop:
But somehow it does not work out the way I want it to and obviously after all iterations are completed within the inner while loop,
my program does not find its way back into the outer while loop to start over again:
Code:
#include <stdio.h>
int main() {
int i = 1, j = 1;
while(i <= 5) {
while(j <= 5) {
printf("%4d", i * j);
j++;
}
printf("\n");
i++;
}
return 0;
}
I cannot spot my mistake and would appreciate any help.^^
regards,
Placebo