Task: Set an NxM integer matrix from the keyboard. Find in each odd row of the matrix element with the minimum value. Display the positions and values of the items found.
Here is the program code:
#include <stdio.h> #include <stdlib.h> #include <string.h> int main () { int n,m; int mas2[4][4]; for (n = 1; n<4; n++) { for (m = 1; m<4; m++) { printf ("mas2[%d,%d] = ", n,m); scanf ("%d", &mas2[n] [m]); // Ввод массива } } for (n = 1; n<4; n++) { for (m = 1; m<4; m++) { printf ("%d ", mas2[n] [m]); // Вывод массива } printf ("\n"); } for (n = 1; n <4; n++) { for (m = 1; m <4; m++) { if ((n) % 2 != 0) { printf ("mas2[%d,%d] = %d\n", n,m,mas2[n] [m]); // Вывод нечетных строк } } } } I organized the output of odd lines, it is impossible to output the positions and values of elements with the minimum value in these lines.
your_variable % 2 == 0- this sort of even has always been - LFC