Write a interactive C program to find the MINIMUM array elements in a given 3X3 matrix.
#include <stdio.h> #include <limits.h> int main() { int matrix[3][3]; printf("Enter the elements one-by-one:\n"); for(int row = 0; row < 3; row++) { for(int col = 0; col < 3; col++) { printf("%d %d: ", row+1, col+1); scanf("%d", &matrix[row][col]); printf("\n"); } } int min = INT_MAX; int max = INT_MIN; for(int i = 0; i < 3; i++){ for(int j = 0; j < 3; j++) { if(matrix[i][j] < min) min = matrix[i][j]; if(matrix[i][j] > max) max = matrix[i][j]; } } printf("Minimum value: %d\nMaximum Value: %d", min, max); return 0; }
Also in C:
- calculate max of three numbers using ternary operator in c
- is 33 prime number
- how to add a comment in c
- c remove element from array
- es palindromo
- how can i remove a specific item from an array
- error: dereferencing pointer to incomplete type
- diferencia entre * y & en c
- c unused parameter
- how to make infinite loop in c
- arduino ip to string
- how to create random integers from a specific range in c language
- global and local variables in c
- c matrix sintax
- terminal size in c
- how to pass props to higher order component
- uint32_t extract first bits
- check if audio is muted python
- arduino keypad wait for key
- how do pointers work in c programmwiz
- strncpy c
- c switch
- latex noindent
- what is fprintf in c