You are viewing a single comment's thread. Return to all comments →
Now we encounter the problem based on the basics of c++ ; "we can't use datastructures or any arrays".
so I get the code
CODE :
using namespace std;
int main() { // Complete the code. int n,m;
cin>>n>>m; // cout<<n<<m; for(int i=n;i<=m;i++){ if(i==1){ cout<<"one"<<"\n"; } else if(i==2){ cout<<"two"<<"\n"; } else if(i==3){ cout<<"three"<<"\n"; } else if(i==4){ cout<<"four"<<"\n"; } else if(i==5){ cout<<"five"<<"\n"; } else if(i==6){ cout<<"six"<<"\n"; } else if(i==7){ cout<<"seven"<<"\n"; } else if(i==8){ cout<<"eight"<<"\n"; } else if(i==9){ cout<<"nine"<<"\n"; } else if(i>9){ if(i%2 ==0){ cout<<"even"<<"\n"; } else{ cout<<"odd"<<"\n"; } } } 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 →
Now we encounter the problem based on the basics of c++ ; "we can't use datastructures or any arrays".
so I get the code
CODE :
include
include
using namespace std;
int main() { // Complete the code. int n,m;
}
}