Skip to content

Commit 2eabbf5

Browse files
Create 2ifelse.cpp
1 parent 8dbef9d commit 2eabbf5

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

2ifelse.cpp

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/* Input Format
2+
3+
A single integer, .
4+
5+
Constraints
6+
7+
Output Format
8+
9+
If , then print the lowercase English word corresponding to the number (e.g., one for , two for , etc.); otherwise, print Greater than 9.
10+
11+
Sample Input 0
12+
13+
5
14+
Sample Output 0
15+
16+
five
17+
Explanation 0
18+
19+
five is the English word for the number .
20+
21+
Sample Input 1
22+
23+
8
24+
Sample Output 1
25+
26+
eight
27+
Explanation 1
28+
29+
eight is the English word for the number .
30+
31+
Sample Input 2
32+
33+
44
34+
Sample Output 2
35+
36+
Greater than 9 */
37+
38+
39+
#include <bits/stdc++.h>
40+
41+
using namespace std;
42+
int main()
43+
{
44+
// Write your code here
45+
if(n>9){
46+
cout << "Greater than 9";
47+
}
48+
else{
49+
if (n>8){
50+
cout << "nine";
51+
}
52+
else{
53+
if(n>7){
54+
cout<<"eight";
55+
}
56+
else{
57+
if(n>6){
58+
cout<<"seven";
59+
}
60+
else {
61+
if(n>5){
62+
cout<<"six";
63+
}
64+
else{
65+
if(n>4){
66+
cout<<"five";
67+
}
68+
else{
69+
if(n>3){
70+
cout<<"four";
71+
}
72+
else {
73+
if(n>2){
74+
cout<<"three";
75+
}
76+
else{
77+
if(n>1){
78+
cout<<"two";
79+
}
80+
else{
81+
if(n>0){
82+
cout<<"one";
83+
}
84+
else{
85+
cout<<"invalid entry";
86+
}
87+
}
88+
}
89+
}
90+
}
91+
}
92+
}
93+
}
94+
}
95+
}
96+
97+
return 0;
98+
}
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
109+
110+
111+

0 commit comments

Comments
 (0)