Skip to content

Instantly share code, notes, and snippets.

@gokhanyavas
Created May 16, 2013 06:59
Show Gist options
  • Save gokhanyavas/5589897 to your computer and use it in GitHub Desktop.
Save gokhanyavas/5589897 to your computer and use it in GitHub Desktop.
NxN boyutlu bir matrisin sütunları toplamını başka bir diziye atayan c programı.
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,n;
int mat[10][10];
int dizi[10];
printf("Kare Matrisin Boyutu ..:");
scanf("%d",&n);
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
printf("%d. satir, %d.sutun elemani : ",i,j);
scanf("%d",&mat[i][j]);
}
for(i=1;i<=n;i++)
dizi[i]=0;
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
dizi[j]=dizi[j]+mat[i][j];
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
printf("%5d",mat[i][j]);
printf("\n");
}
printf("\n");
for(i=1;i<=n;i++)
printf("%5d",dizi[i]);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment