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.

I am writing a code and I need help, it compiles but

#include #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; imax) max=data[i][j]; if(data[i][j] CS 100 Lab Seven Spring 2017 Create a directory called lab7 on your machine using mkdir lab7 Within this directory, complete the program named lab7.c that is shown below. You need to write the five functions shown in red #include

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!