Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Find the maximum and minimum values of all elements in a forming matrix with 4 rows and 4 columns.
Find the maximum and minimum values of all elements in a forming matrix with 4 rows and 4 columns.
void main()

{

int a[4][4]={ 1,2,3,4,5,6,7,8,9,0, 1 12, 13, 14, 15, 16 };

int min,max

int i,j;

min = max = a[0][0];

for(I = 0; I<4; i++)

for(j = 0; j & lt4; j++)

{

if(a[I][j]& gt; Max)

max = a[I][j];

if(a[I][j]& lt; Minimum)

min = a[I][j];

}

Printf ("max %d and min %d", max, min);

}