Input Format
You will be given two positive integers,  and  (), separated by a newline.
Output Format
For each integer  in the interval  :
  • If , then print the English representation of it in lowercase. That is "one" for , "two" for , and so on.
  • Else if  and it is an even number, then print "even".
  • Else if  and it is an odd number, then print "odd".

hackerrank for loop problem solution in c++ programming

For Loop problem solution in C++ programming | HackerRank

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main() {

    int a, b;
    string represent[10] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
    cin >> a >> b;
    for(int i = a; i <= b; i++) {
        if(i > 9) {
            if(i % 2 == 0)
                cout << "even\n";
            else cout << "odd\n";
        else {
            cout << represent[i]<<endl;
    return 0;