You are viewing a single comment's thread. Return to all comments →
#include <iostream> using namespace std; int main() { int a, b; cin >> a; cin >> b; string num[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "even", "odd"}; int i =0; for (i=a; i<=b; i++){ if (i<=9) cout <<num[i]<< endl; else if ( (i>9) && (i%2)==0) cout << "even" << endl; else if ( (i>9) && (i%2)==1) cout << "odd" << endl; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
For Loop
You are viewing a single comment's thread. Return to all comments →