Skip to content

Commit 63fc623

Browse files
authored
Create Conditional Statements
1 parent e425a2a commit 63fc623

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

HackerRank/Conditional Statements

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include <iostream>
2+
3+
using namespace std;
4+
5+
int main()
6+
{
7+
int n;
8+
cin >> n;
9+
10+
if(n <= 9){
11+
if (n == 1) cout << "one";
12+
else if (n == 2) cout << "two";
13+
else if (n == 3) cout << "three";
14+
else if (n == 4) cout << "four";
15+
else if (n == 5) cout << "five";
16+
else if (n == 6) cout << "six";
17+
else if (n == 7) cout << "seven";
18+
else if (n == 8) cout << "eight";
19+
else if (n == 9) cout << "nine";
20+
}
21+
else if(n > 9){
22+
cout << "Greater than 9";
23+
}
24+
25+
return 0;
26+
}

0 commit comments

Comments
 (0)