We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
case 1: cout<<"one"<<endl;
break;
case 2: cout<<"two"<<endl;
break;
case 3: cout<<"three"<<endl;
break;
case 4: cout<<"four"<<endl;
break;
case 5: cout<<"five"<<endl;
break;
case 6: cout<<"six"<<endl;
break;
case 7: cout<<"seven"<<endl;
break;
case 8: cout<<"eight"<<endl;
break;
case 9: cout<<"nine"<<endl;
break;
}
}
}
return 0;
}
1. > # ****
Cookie support is required to access HackerRank
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 →
include
include
using namespace std;
int main() { int i,a,b; cin>>a>>b; for(i= a; i<= b ; i++ ){ if(i > 9){ if(i%2==0){ cout << "even" << endl; } else{ cout << "odd" << endl; }
} else { switch(i){
} 1. > # ****