Gıda – Web – Teknoloji != Hasanibrahim

Tag: C toplama

İlk Ödevim: topla bol

by on Mar.06, 2009, under ANSI C, Ödevler

<strong>#include stdio.h
#include stdlib.h</strong>
 
float bol(a,b)
int a,b;
{
    float c;
      c = (float) a/b;
      return c;
}
 
int topla(d,z)
int d,z;
{
    int y;
    y= d + z;
    return y;
}
int main()
{
    int x,y,z;
    int toplananSayi;
    float bolunenSayi;
    printf("Aralarina virgul koyarak uc sayi giriniz, ORNEK 34, 22, 16 veya  9,3, 5 gibin");
    printf("Gireceginiz ilk iki sayi toplanacak ve ucuncu sayiya bolunecektir.n");
    scanf("%d, %d, %d", &amp;x, &amp;y, &amp;z);
    toplananSayi=topla(x,y);
    bolunenSayi=bol(toplananSayi,z);
    printf("Sonuc %f dir", bolunenSayi);
 
  system("PAUSE"); 
  return 0;
}

Fonksiyonla bu islemi daha kolaylastirabilirdik :)

Leave a Comment :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...