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