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"); } }
3 Antworten
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.
0
Please,explain me the full code line by line
0
Have you finished the course here yet? For your coding, you should at least learnt 2D array, loop, formatting string to understand it.