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