-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
48 lines (39 loc) · 814 Bytes
/
main.c
File metadata and controls
48 lines (39 loc) · 814 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
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i, n = 7, sonuc, j, son, array[] = {6, 14, 43, 53, 64, 32, 24};
sonuc = 1;
son = 0;
printf("ba?langiç dizisi: ");
for (i = 0; i < n; i++)
{
printf("%d ", array[i]);
}
for (i = 0; i < n; i++)
{
if (array[i] % 2 == 0)
{
array[i] = 0;
}
else
{
array[i] = 1;
}
}
printf("\n parite dizisi: ");
for (i = 0; i < n; i++)
{
printf("%d ", array[i]);
}
for (i = 0; i < n; i++)
{
for (j = n - 1; j >= 0; j--)
{
sonuc *= 2;
}
son += array[i] * sonuc;
}
printf("\n guvenlik kodu: %d \n", son);
return 0;
}