answersLogoWhite

0

Store the first value in the matrix, then compare every value in the matrix with the stored value, replacing the stored value if the current value is smaller. For instance, the following snippet will locate the smallest int value in a 3x4 matrix named A:

int smallest=A[0][0];

for(int x=0; x<3; ++x )

{

for(int y=0; y<4; ++y )

{

if(A[x][y]<smallest )

{

smallest=A[x][y];

}

}

}

User Avatar

Wiki User

11y ago

What else can I help you with?

Related Questions

A c program to find maximum number in a 3 by 3 matrix?

int matrix[][]; // the matrix to find the max in int max = matrix[0][0]; int r,c; for(r = 0; r &lt; 3; ++r) { for(c = 0; c &lt; 3; ++c) { if(matrix[r][c] &gt; max) { max = matrix[r][c]; } } } // max is now the maximum number in matrix


If properties of matrix addition let A B C D the m n matrix then 1 A plus B B plus A?

Yes. Matrix addition is commutative.


A plus b plus c equals d. A is the largest answer b is the smallest answer and d is less than 6?

A plus b plus c equals d. A is the largest answer b is the smallest answer and d is less than 6?''


How do you find matrix in c?

using multidimensional array


What are the three variable types largest to smallest in C plus plus?

doginert jesret


How do you Write A program in c language for checking a diagonal matrix?

Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.


What is the product of matrix A and C?

It's matrix C.


Write a C program to find sum of 3 matrices?

matrix


Write a C program using dynamic memory allocation to find the sum of elements of a matrix?

Did you know that memory allocation is not needed to display the matrix? However, the C program is to find the sum of all the elements.


C plus plus program -matrix multiplication using class?

for(int i=0;i


How to find the smallest number in c code?

smallest = min (one_number, another_number); ...or... smallest = one_number &lt; another_number ? one_number : another_number;


How do you write a program in c plus plus to check if an array is symmetric?

To determine if an array is symmetric, the array must be square. If so, check each element against its transpose. If all elements are equal, the array is symmetric.For a two-dimensional array (a matrix) of order n, the following code will determine if it is symmetric or not:templatebool symmetric(const std::array& matrix){for (size_t r=0 ; r