-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path8.43.cpp
More file actions
51 lines (48 loc) · 816 Bytes
/
8.43.cpp
File metadata and controls
51 lines (48 loc) · 816 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
43
44
45
46
47
48
49
50
51
#include<stdio.h>
int main()
{
int a=0,b=0,c=0,f=0,secim;
float ortalama;
char harf;
while(1)
{
printf("Harf notunu giriniz (Cikis icin H yada h giriniz):");
scanf("%s",&harf);
if(harf=='H' || harf=='h')
{
break;
}
if(harf=='A')
{
a++;
}
if(harf=='B')
{
b++;
}
if(harf=='C')
{
c++;
}
if(harf=='F')
{
f++;
}
if(harf=='A' || 'B' || 'C' || 'F')
{
continue;
}
else
{
printf("Gecersiz not!!!!\n");
}
}
ortalama=(float)(a*4+b*3+c*2)/(a+b+c+f);
printf("Girilen A larin sayisi: %d\n",a);
printf("Girilen B lerin sayisi: %d\n",b);
printf("Girilen C lerin sayisi: %d\n",b);
printf("Girilen F lerin sayisi: %d\n",f);
printf("Toplam harf sayisi : %d\n",a+b+c+f);
printf("Ortalama : %.1f\n",ortalama);
return 0;
}