include
int main(){
int i,j,r,c;
printf(“Enter the no of rows and columns:\n”);
scanf(“%d%d”,&r,&c);
int m[r][c];
printf("Enter the elments of matrix:\n");
for(i=0;i<r;i++){
for(j=0;j<c;j++){
scanf("%d",&m[i][j]);
}
}
int large=m[0][0];
int small=m[0][0];
for(i=0;i<r;i++){
for(j=0;j<c;j++){
if(m[i][j]>large){
large=m[i][j];
}
if(m[i][j]<small){
small=m[i][j];
}
}
}
printf("Large : %d\n Small : %d\n",large,small);
return 0;
}
Leave a Reply