-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFor Loop in C(Hacker Rank).c
More file actions
67 lines (61 loc) · 1.14 KB
/
Copy pathFor Loop in C(Hacker Rank).c
File metadata and controls
67 lines (61 loc) · 1.14 KB
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>
#include <math.h>
#include <stdlib.h>
int main()
{
int a, b,n;
scanf("%d\n%d", &a, &b);
n=0;
for(n=a;n<=b;n++)
{
if(n==1)
{
printf("one\n");
}
if(n==2)
{
printf("two\n");
}
if(n==3)
{
printf("three\n");
}
if(n==4)
{
printf("four\n");
}
if(n==5)
{
printf("five\n");
}
if(n==6)
{
printf("six\n");
}
if(n==7)
{
printf("seven\n");
}
if(n==8)
{
printf("eight\n");
}
if(n==9)
{
printf("nine\n");
}
if(n>9)
{
if(n%2==0)
{
printf("even\n");
}
else
{
printf("odd\n");
}
}
}
return 0;
}