Given the array A filled with random integers and using row and col correctly fi
ID: 3765579 • Letter: G
Question
Given the array A filled with random integers and using row and col correctly find the smallest number and print it: (Answer: in c language)Int A[10][20]; Int row, col, min, I; FillArray(A); //assume this fills the array Given the array A filled with random integers and using row and col correctly find the smallest number and print it: (Answer: in c language)
Int A[10][20]; Int row, col, min, I; FillArray(A); //assume this fills the array (Answer: in c language)
Int A[10][20]; Int row, col, min, I; FillArray(A); //assume this fills the array
Explanation / Answer
Given :
int row,col,min;
int A[row][col]; // row is number of rows and col is number of columns
FillArray(A);// assume this fills the array with random numbers
---------------------------------------------------------------------------------------------
Answer :
---------------------------------------------------------------------------------------------
int i,j; // used in loops
for(i = 0 ; i < row ; i++) // row traverse
for(j = 0 ; j < col ; j++) // col traverse
if(A[i][j] < min) // min check
min = A[i][j]; // min update
printf("The min integer in the given array A = %d",min); // print min
------------------------------------------------------------------------------------------
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.