You are viewing a single comment's thread. Return to all comments →
int main() {
int num1, num2; cin>>num1>>num2; string str_arr[9] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; int iterations = num2 - num1; for (int i = 0; i<iterations+1; i++) { static int num = num1; if(num>9) { num%2==0 ? cout<<"even"<<endl:cout<<"odd"<<endl; num++; } else { cout<<str_arr[num-1]<<endl; num++; } } 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 →
int main() {
}