Question: I am writing a code and I need help, it compiles but I get the wrong output, it doesn't match up with what I have
I am writing a code and I need help, it compiles but I get the wrong output, it doesn't match up with what I have to get when I do ./a.out 2 2, please help.

#include
int **allocateMatrix(int,int); void initMatrix(int**,int,int); int findRange(int**,int ,int); double findAverage(int**,int,int); void printCorners(int**,int,int);
int main(int argc,char *argv[]) { srand(0); int **data; int row=atoi(argv[1]); int col=atoi(argv[2]);
data=allocateMatrix(row,col); initMatrix(data,row,col); printf("Range of value in the array is %d ",findRange(data,row,col)); printf("Average of all array values is %1f ",findAverage(data,row,col)); printCorners(data,row,col); return 0; }
int** allocateMatrix(int row,int col) { int **arr = (int **)malloc(row * sizeof(int *)); int i; for (i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
