Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IFF - Introdução à Programação
- //Slide - Página 48 - Exercício 4
- #include<stdio.h>
- #include<locale.h>
- int main(){
- setlocale(LC_ALL,"Portuguese");
- int matriz[3][3], soma[3]={0,0,0};
- for (int c=0;c<3;c++){
- for(int l=0;l<3;l++){
- printf("Entre com o valor da posição (%d,%d): ",l+1,c+1);
- scanf("%d",&matriz[l][c]);
- soma[c]+=matriz[l][c];
- }
- }
- for(int i=0;i<3;i++) printf("\nA soma da %dª coluna: %d",i+1,soma[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment