answersLogoWhite

0

int matrix[][]; // the matrix to find the max in

int max = matrix[0][0];

int r,c;

for(r = 0; r < 3; ++r) {

for(c = 0; c < 3; ++c) {

if(matrix[r][c] > max) {

max = matrix[r][c];

}

}

}

// max is now the maximum number in matrix

User Avatar

Wiki User

16y ago

Still curious? Ask our experts.

Chat with our AI personalities

BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran

Add your answer:

Earn +20 pts
Q: A c program to find maximum number in a 3 by 3 matrix?
Write your answer...
Submit
Still have questions?
magnify glass
imp