Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main(void)
  4.    {
  5.     int mat[3][4];
  6.     int lin, col;
  7.     int i, j;
  8.     int soma = 0;
  9.    
  10.     for(lin=0 ; lin<3 ; lin++)
  11.     {
  12.     for(col=0 ; col<4 ; col++)
  13.     {  
  14.        printf("Digite os numeros da tabela : ");
  15.        scanf("%d",&mat[lin][col]);
  16.     }
  17.     }
  18.     for(i=0 ; i<3 ; i++)
  19.     {
  20.     for(j=0 ; j<4 ; j++)
  21.     {
  22.        printf("%d",mat[i][j]);
  23.        
  24.     }
  25.     printf(" \n");
  26.     }
  27.    
  28.     for(j=0 ; j<4 ; j++)
  29.     {
  30.    
  31.     for(i=0 ; i< ; i++)
  32.     {
  33.         soma=soma+mat[i][j];
  34.        
  35.     }
  36.     }
  37.     printf("A soma dos elementos da matriz e' : %d", j,soma);
  38.   system("pause");
  39.   return 0;
  40.  
  41.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement