Question: Need this code converted so it does not have any pointers implemented #include #include int max(int m,int n,int array[m*n]) { int i,j,currentMax=array[0]; //To store current
Need this code converted so it does not have any pointers implemented
#include #include int max(int m,int n,int array[m*n]) { int i,j,currentMax=array[0]; //To store current maximum value for (i = 0; i < m; ++i) { for (j = 0; j < n; ++j) { if(currentMax < array[i*n+j]) //Larger elements appears currentMax = array[i*n+j]; //update current maximum } } return currentMax; } void rowSum(int m,int n,int array[m*n]) { int i,j,sum; //To store total sum for (i = 0; i < m; ++i) { sum = 0; for (j = 0; j < n; ++j) sum = sum + array[i*n+j] ; //Add sum of every row element printf("Sum of row %d is %d ",i+1,sum); } printf(" "); } void columnSum(int m,int n,int array[m*n]) { int i,j,sum; //To store total sum for (j = 0; j < n; ++j) { sum = 0; for (i = 0; i < m; ++i) sum = sum + array[i*n+j]; //Add sum of every column element printf("Sum of column %d is %d ",j+1,sum); } printf(" "); } void isSquare(int m,int n,int array[m*n]) { if(m==n) //check whether number of rows and columns are same printf("This is a square array "); else printf("This is not a square array "); printf(" "); } void displayOutputs(int m,int n,int array[m*n]) { int i,j; printf("Here is your 2D array: "); for(i=0; i