-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path8.56.cpp
More file actions
42 lines (41 loc) · 695 Bytes
/
8.56.cpp
File metadata and controls
42 lines (41 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include<stdio.h>
int main()
{
int hafif=0,orta=0,agir=0,sayac=0,top=0;
float ortalama,kilo;
while(1)
{
printf("Kilo giriniz: ");
scanf("%f",&kilo);
if(kilo==0)
{
printf("---------------------------------------\n");
break;
}
if(kilo<0)
{
printf("Hata!!!!Kilo negatif olamaz tekrar giriniz\n");
}
else
{
top+=kilo;
sayac++;
if(kilo<50)
{
hafif++;
}
if(kilo>=50 && kilo<70)
{
orta++;
}
if(kilo>=70)
{
agir++;
}
}
}
ortalama=(float)top/sayac;
printf("Toplam %d adet sporcu girilmistir\n",sayac);
printf("%d hafif, %d orta ve %d agir siklet vardir\n",hafif,orta,agir);
printf("Genel ortalama %.2f",ortalama);
}