-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDeitel_5.18.c
44 lines (36 loc) · 1.02 KB
/
Deitel_5.18.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
/* Bes tamsayi girisi yapan ve sayilari birer birer cift adi verilen bir fonksiyona gonderen program yazilacak.
Sayilar cift ise 1, tek ise 0 sonucu dondurulecek. //YAZAN: Yigit YILMAZ */
#include <stdio.h>
#include <conio.h>
int cift(int a);
int main()
{
int bir,iki,uc,dort,bes;
printf("5 tamsayi girin :\n");
scanf("%d%d%d%d%d", &bir,&iki,&uc,&dort,&bes);
if(cift(bir))
printf("\n%d cift sayidir\n", bir);
else
printf("\n%d tek sayidir\n", bir);
if(cift(iki))
printf("%d cift sayidir\n", iki);
else
printf("%d tek sayidir\n", iki);
if(cift(uc))
printf("%d cift sayidir\n", uc);
else
printf("%d tek sayidir\n", uc);
if(cift(dort))
printf("%d cift sayidir\n", dort);
else
printf("%d tek sayidir\n", dort);
if(cift(bes))
printf("%d cift sayidir\n", bes);
else
printf("%d tek sayidir\n", bes);
getch();
return 0;
}
int cift(int a){
return !(a%2);
}