I have a code that can return me the maximum value in a giving array (like below ). how can I change it to return me the maximum value for each row.
for example, I wan to the code return me like
the maximum value in row 1 is: 4
the maximum value in row 2 is: 8
the maximum value in row 3 is: 4
main (){
int i,j, max;
for (i=0; i<3 ; i++){
max = 0;
for (j=0; j<3; j++){
if (t[i][j]>max) {
max=t[i][j];
}
}
printf("max vaule is : %d\n",max );
}
system("pause");
return 0;
}