-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStructÖrnek2.c
More file actions
46 lines (44 loc) · 1010 Bytes
/
Copy pathStructÖrnek2.c
File metadata and controls
46 lines (44 loc) · 1010 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
#include <stdio.h> //DÜZELTÝLECEK
#include <stdlib.h>
#define SIZE 3
struct Bp1Vize{
int no;
float vize;
};
float ortalamaBul (struct Bp1Vize Notlar[]);
int main(){
//int liste [SIZE];
struct Bp1Vize liste [SIZE];
int i=0;
float ortalama;
while(liste[i].no!=liste[i+1].no){
printf("\n%d. Ogrencinin Numarasi:",i+1);
scanf("%d",&liste[i].no);
printf("\n%d. Ogrencinin Vize notu:",i+1);
scanf("%f",&liste[i].vize);
i++;
if(i==SIZE){
break;
}
}
/*for(i=0;i<SIZE;i++){
printf("\n%d. Ogrencinin Numarasi:",i+1);
scanf("%d",&liste[i].no);
printf("\n%d. Ogrencinin Vize notu:",i+1);
scanf("%f",&liste[i].vize);
}*/
/*if(liste[i].no==liste[i+1].no){
printf("Ogrenci Nolari ayni olamaz!!");
}*/
ortalama=ortalamaBul(liste);
printf("\nSinif ortalamasi: %f",ortalama);
return 0;
}
float ortalamaBul (struct Bp1Vize notlar[]){
int i;
float toplam=0;
for(i=0;i<SIZE;i++){
toplam+=notlar[i].vize;
}
return toplam/SIZE;
}