-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathif_else2.c
95 lines (94 loc) · 1.63 KB
/
if_else2.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
// Write a programe to print number in words only for 2 digit number
// => 78
// seven eight
#include<stdio.h>
void main()
{
int number,first,second;
printf("Enter value of number ");
scanf("%d",&number);
first = number / 10;
second = number % 10;
// printf("the value of first is %d ",first);
// printf("\nthe value of second is %d ",second);
if(first==1)
{
printf("One ");
}
else if(first == 2)
{
printf("Two ");
}
else if(first==3)
{
printf("Three ");
}
else if(first==4)
{
printf("Four ");
}
else if(first==5)
{
printf("Five ");
}
else if(first ==6)
{
printf("Six ");
}
else if(first==7)
{
printf("Seven ");
}
else if(first ==8)
{
printf("Eight ");
}
else if(first==9)
{
printf("Nine ");
}
else if(first==0)
{
printf("Zero ");
}
if(second==1)
{
printf("One ");
}
else if(second == 2)
{
printf("Two ");
}
else if(second==3)
{
printf("Three ");
}
else if(second==4)
{
printf("Four ");
}
else if(second==5)
{
printf("Five ");
}
else if(second ==6)
{
printf("Six ");
}
else if(second==7)
{
printf("Seven ");
}
else if(second ==8)
{
printf("Eight ");
}
else if(second==9)
{
printf("Nine ");
}
else if(second==0)
{
printf("Zero ");
}
}