C Dili Manuel Olarak Girilen Matris

C dili matris oluşturma örneği...

Scanf ile kullanıcıdan alınan değerler ile 3x3 matris oluşturma.


#include <stdio.h>
#define SUT 3
#define SAT 3
int main ()
{
int i,j,f, a[SAT][SUT];
for( i=0; i<SAT; i++)
    {
    for(j=0; j<SUT; j++)
    {
    printf("%d ninci satir %d ninci sutun degerini giriniz = ",i+1,j+1);
    scanf("%d",&f);
    a[i][j]=f;
  }
}

puts("matris    : ");
for(i=0; i<SAT; i++)
{
    for(j=0;j<SUT;j++)
    {
    printf("%4d",a[i][j]);
}
    printf("\n");
}
return 0;
}
Googleda paylaş

About Nur Event Design

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Yorumları
    Facebook Yorumları

0 yorum:

Yorum Gönder