Monday, 14 March 2016

Hacker Rank Solution Program In C++ For "Conditional Statements "

#include <iostream>

using namespace std;

int main()
{
int in;
string num[10] = {"Greater than 9", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};

cin >> in;

if(in > 9){
    cout << num[0];
}
else{
    cout << num[in];
}


    return 0;
}

Output:-

programmingwithbasics

No comments:
Write comments

Recommended Posts × +