Skip to content

Instantly share code, notes, and snippets.

@gokhanyavas
Created May 16, 2013 07:10
Show Gist options
  • Save gokhanyavas/5589934 to your computer and use it in GitHub Desktop.
Save gokhanyavas/5589934 to your computer and use it in GitHub Desktop.
Dışarıdan girilen NxN boyutlu bir matriste bazı hatalar oluşmuştur. Bu hatalar sıfır ile gösterilmiştir. Her satırda kaç tane hata olduğunu bulan c programı.
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,n;
int mat[10][10],hata[16];
printf("Satir Sutun Sayisi : ");
scanf("%d",&n);
for(i=0;i<n;i++)
for(j=0;j<n;j++)
{
printf("%d.satir, %d.sutun elemani : ",i,j);
scanf("%d",&mat[i][j]);
}
for(i=0;i<n;i++)
hata[i]=0;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
if(mat[i][j]==0) hata[i]++;
for(i=0;i<n;i++)
printf("%d.sutundaki hata sayisi : %d\n",i,hata[i]);
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment