User:Mahanteshaarohi/sandbox

Write program to read matrix element using single loop

main {  int array[4][4]; int m,n; m=n=0; while(m<4) {     read_element(&array[m][n++]); if(n>=4) {        n=0; m++; }  } }

void read_element(int *address) {  scanf("%d",address); }