Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #define SIZE 4
- int main(int argc, char const *argv[]) {
- int tab[4][4] = { {1, 2, 3, 4},
- {5, 6, 7, 8},
- {9, 10, 11, 12},
- {13, 14, 15, 16} };
- int n = 0, k = 0, min = 0, max = 0, i, j;
- /*
- for(n = 0; n < SIZE; n++)
- for(k = 0; k < SIZE; k++)
- tab[n][k] = k == n;
- */
- for(n = 0; n < SIZE; n++) {
- for(k = 0; k < SIZE; k++){
- printf("%5d", tab[n][k]);
- }
- printf("\n");
- }
- // min = tab[0][0]
- max = tab[0][0]
- for(i = 0; i < n; i++) {
- for(j = 0; j < n; j++) {
- if (min > tab[i][j])
- min = tab[i][j];
- if (max < tab[i][j])
- max = tab[i][j]; }}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement