/*Write a function int numNonZero(int A[][COL], int num_rows, int num_cols) that finds and returns the amount of non-zero elements of the array A. Write a program that performs the following: Declares TWO two-dimensional arrays of integers of size 4X4 each (4 rows and 4 columns) Fills EACH array with the random generated numbers between -3 and 3 using function we wrote in class. Prints EACH random array using function we wrote in class Calculates the number of non-zero elements in each array and prints results with an appropriate message. Finds array with the maximal amount of non-zero elements We will modify and solve it for 10 arrays we will store counters in count array */ #include #include #include #define ROW 4 #define COL 4 #define SIZE 10 void print_array(int A[][COL], int num_row, int num_col); void make_random_array2d(int A[][COL], int num_row, int num_col, int min, int max); void print_array1D(int A[], int size); int numNonZero(int A[][COL], int num_rows, int num_cols); int main(){ srand(time(NULL)); int A[ROW][COL],i, max, max_index, count_array[SIZE]; //processing array 1 make_random_array2d(A,ROW, COL, -3,3); printf("array 1\n"); print_array(A,ROW, COL); count_array[0]=numNonZero(A, ROW, COL); max=count_array[0]; max_index=0; for(i=1;i