Demo entry 6745278

ALİ İHSAN KARSLI

   

Submitted by anonymous on May 26, 2018 at 12:48
Language: C. Code size: 548 Bytes.

#include <stdio.h>

int main()
{
    float adet;

    float toplam = 0;
    float ortalama = 0;

    printf("Kac adet sayi gireceksiniz = ");
    scanf("%f", &adet);

    int i;
    for(i = 1; i <= adet; i++)
    {
        printf("%d. sayiyi giriniz = ", i);
        int degisken;
        scanf("%d", &degisken);
        toplam += degisken;
    }

    ortalama = toplam / adet;

    printf("Girdiginiz sayilarin toplami = %.2f \n", toplam);
    printf("Girdiginiz sayilarin ortalamasi = %.2f", ortalama);

    return 0;
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).