You are viewing a single comment's thread. Return to all comments →
int a,b; char arr[11][6]={"one","two","three","four","five","six","seven","eight","nine","even","odd"}; cin>>a>>b; for( int i = a; i <= b; i++){ if(i < 10) cout<<arr[i-1]<<endl; else if(i % 2 == 0) cout<<arr[9]<<endl; else cout<<arr[10]<<endl; }
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 →