-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQuestion_4.33.c
98 lines (77 loc) · 1.42 KB
/
Question_4.33.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include <stdio.h>
#include <conio.h>
int main(void)
{
int sayi;
printf("******* Romen Rakamina Cevirmek Istediginiz Sayiyi Giriniz. *******\n");
scanf("%d", &sayi);
printf("Romen Rakaminiz : \a ");
while(sayi!=0)
{
if(sayi>=1000)
{
sayi = sayi - 1000;
printf("M");
}
else if(sayi>=900)
{
sayi = sayi - 900;
printf("CM");
}
else if(sayi>=500)
{
sayi = sayi - 500;
printf("D");
}
else if (sayi >= 400) // 400 - cd
{
printf("CD");
sayi = sayi - 400;
}
else if(sayi>=100)
{
sayi = sayi - 100;
printf("C");
}
else if(sayi>=90)
{
sayi = sayi - 90;
printf("XC");
}
else if(sayi>= 50)
{
sayi = sayi - 50;
printf("L");
}
else if(sayi>=40)
{
sayi=sayi-40;
printf("XL");
}
else if (sayi >= 10) // 10 - x
{
printf("X");
sayi = sayi- 10;
}
else if(sayi>=9)
{
sayi = sayi - 9;
printf("IX");
}
else if(sayi>=5)
{
sayi = sayi - 5;
printf("V");
}
else if(sayi>=4)
{
sayi = sayi- 4;
printf("IV");
}
else if (sayi >= 1) // 1 - i
{
printf("i");
sayi = sayi - 1;
}
}
}