Advertisement
renix1

matriz

Aug 31st, 2018
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int maxL = 3, maxC = 3;
  6.     int matriz[maxL][maxC];
  7.    
  8.     for (int i=0; i<maxL; i++) {
  9.         for (int j=0; j<maxC; j++) {
  10.             printf("Entrada para a linha %d coluna %d: ", i, j);
  11.             scanf("%d", &matriz[i][j]);
  12.         }
  13.     }
  14.    
  15.    
  16.     for (int i=0; i<maxL; i++) {
  17.         for (int j=0; j<maxC; j++) {
  18.             printf("Linha %d, coluna %d = %d\n", i, j, matriz[i][j]);
  19.         }
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement