Advertisement
Schknheit

matrix 2x2

May 15th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  4.    
  5.     int i, j, mat[2][2];
  6.    
  7.     printf("Entre com quatro elementos: \n");
  8.    
  9.     for(i = 0; i < 2; i++){
  10.         for(j = 0; j < 2; j++){
  11.             scanf("%d",&mat[i][j]);
  12.         }
  13.     }
  14.    
  15.     for(i = 0; i < 2; i++){
  16.             printf("\n");
  17.         for(j = 0; j < 2; j++){
  18.             printf("%d\t", mat[i][j]);
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement