Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int a[20][20]={{1,2,0,4},
- {0,6,7,0},
- {3,0,5,6}};
- int i,j;
- int n=3;
- int m=4;
- int suma=0;
- int suma1=0;
- int suma2=0;
- int max;
- int p=1;
- int k;
- for(i=0;i<n;i++){
- for(j=0;j<m;j++){
- printf("%d ",a[i][j]);
- }
- printf("\n");
- }
- for(i=0;i<n;i++){
- for(j=0;j<m;j++){
- suma=suma+a[i][j];
- }
- }
- max=a[0][0];
- for(i=0;i<n;i++){
- for(j=0;j<m;j++){
- if(max<a[i][j])
- max=a[i][j];
- }
- }
- for(j=0;j<m;j++){
- suma1=suma1+a[0][j];
- }
- for(i=0;i<n;i++){
- suma2=suma2+a[i][1];
- }
- printf("Unesite zeljenu kolonu");
- scanf("%d",&k);
- for(i=0;i<n;i++){
- if(a[i][k]!=0)
- p=p*a[i][k];
- }
- printf("Suma je %d",suma);
- printf("\nMax je %d",max);
- printf("\nSuma prvog reda %d",suma1);
- printf("\nSuma druge kolone %d",suma2);
- printf("\nProizvod %d kolone je %d ",k,p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement