0

Why the nested for loop is brought here?,please,explain me.

#include <stdio.h> int main() { int j,i,n; printf("Input upto the table number starting from 1 : "); scanf("%d",&n); printf("Multiplication table from 1 to %d \n",n); for(i=1;i<=10;i++) { for(j=1;j<=n;j++) { if (j<=n-1) printf("%dx%d = %d, ",j,i,i*j); else printf("%dx%d = %d",j,i,i*j); } printf("\n"); } }

16th Aug 2022, 8:17 AM
Md Motasim Billah
Md Motasim Billah - avatar
3 ответов
0
Every 2d matrix run around are supposed to use nested loop. The function will apply to every column of one row first in the inner loop, then go to second row by the outer loop, until it run to the last column of the last row.
16th Aug 2022, 11:10 AM
abpatrick catkilltsoi
abpatrick catkilltsoi - avatar
0
Please,explain me the full code line by line
16th Aug 2022, 11:11 AM
Md Motasim Billah
Md Motasim Billah - avatar
0
Have you finished the course here yet? For your coding, you should at least learnt 2D array, loop, formatting string to understand it.
16th Aug 2022, 11:16 AM
abpatrick catkilltsoi
abpatrick catkilltsoi - avatar