-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUntitled22.c
67 lines (55 loc) · 1.27 KB
/
Untitled22.c
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdio.h>
#include <string.h>
typedef struct ogrenci
{
char ad[50];
char soyad[50];
int numara;
float notu;
};
ogrenci bilgiDoldur();
void adSoyadYazdir(ogrenci bilgi);
void notNumaraYazdir(ogrenci *bilgi);
void notGuncelle(ogrenci *bilgi);
void numaraGuncelle(ogrenci *bilgi);
int main()
{
ogrenci ogrenci1;
ogrenci1 = bilgiDoldur();
adSoyadYazdir(ogrenci1);
notNumaraYazdir(&ogrenci1);
notGuncelle(&ogrenci1);
notNumaraYazdir(&ogrenci1);
numaraGuncelle(&ogrenci1);
notNumaraYazdir(&ogrenci1);
return 0;
}
ogrenci bilgiDoldur()
{
ogrenci bilgi;
strcpy(bilgi.ad, "aaa");
strcpy(bilgi.soyad, "bbbbb");
bilgi.numara = 55;
bilgi.notu = 3.5;
return bilgi;
}
void adSoyadYazdir(ogrenci bilgi)
{
printf("Ogrenci 1 adi : %s \n",bilgi.ad);
printf("Ogrenci 1 soyadi : %s \n",bilgi.soyad);
}
void notNumaraYazdir(ogrenci *bilgi)
{
printf("Ogrenci 1 numarasi : %d \n",bilgi->numara);
printf("Ogrenci 1 notu : %f \n\n",bilgi->notu);
}
void notGuncelle(ogrenci *bilgi)
{
printf("Not guncelleniyor\n");
bilgi->notu = 1.2;
}
void numaraGuncelle(ogrenci *bilgi)
{
printf("Numara guncelleniyor\n");
bilgi->numara = 111;
}