Maybe this will clear things up:
Code:
int main()
{
int i, j, x;
printf("Enter a number between 1 to 20 (1-20): ");
scanf("%d", &x);
puts("------ printing values for 'j' ------");
for ( i = x; i <= x + 3; i++ ) {
for ( j = x; j <= x+3; j++ ) {
printf( "\tj: %d", j);
//printf( "\ti: %d", i);
}
printf( "\n" );
}
puts("------ printing values for 'i' ------");
for ( i = x; i <= x + 3; i++ ) {
for ( j = x; j <= x+3; j++ ) {
//printf( "\tj: %d", j);
printf( "\ti: %d", i);
}
printf( "\n" );
}
return 0;
}
So you see, the inner loop only needs *one* print statement. Furthermore, it just needs to print the product of the two values at that point (notice how if you multiplied the same row/column of the two output tables you'd get the value you're looking for).