Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include<stdio.h>
  2. #define SIZE 4
  3.  
  4. int main(int argc, char const *argv[]) {
  5. int tab[4][4] = { {1, 2, 3, 4},
  6. {5, 6, 7, 8},
  7. {9, 10, 11, 12},
  8. {13, 14, 15, 16} };
  9. int n = 0, k = 0, min = 0, max = 0, i, j;
  10. /*
  11. for(n = 0; n < SIZE; n++)
  12. for(k = 0; k < SIZE; k++)
  13. tab[n][k] = k == n;
  14. */
  15. for(n = 0; n < SIZE; n++) {
  16. for(k = 0; k < SIZE; k++){
  17. printf("%5d", tab[n][k]);
  18. }
  19. printf("\n");
  20. }
  21. // min = tab[0][0]
  22. max = tab[0][0]
  23. for(i = 0; i < n; i++) {
  24. for(j = 0; j < n; j++) {
  25. if (min > tab[i][j])
  26. min = tab[i][j];
  27. if (max < tab[i][j])
  28. max = tab[i][j]; }}
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement