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.
- Prepare
- C++
- Introduction
- For Loop
- Discussions
For Loop
For Loop
Sort by
recency
|
1643 Discussions
|
Please Login in order to post a comment
include
include
using namespace std;
int main() { // Complete the code string ones[]={"zero","one","two","three","four","five","six","seven","eight","nine"}; int a,b; cin>>a>>b; if(b<=9){ for(int i=a;i<=b;i++){ cout<
}}
include
include
using namespace std;
int main() { // Complete the code string ones[]={"zero","one","two","three","four","five","six","seven","eight","nine"}; int a,b; cin>>a>>b; if(b<=9){ for(int i=a;i<=b;i++){ cout<
}}
return 0;
int main() { int a , b; cin>>a; cin>>b; // Complete the code. for(int i=a;i<=b;i++ ,a++){ 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%2==0){ cout<<"even\n"; } else{ cout<<"odd\n"; } }
}