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
|
1600 Discussions
|
Please Login in order to post a comment
int n,n1; cin>>n >>n1;
include
include
using namespace std;
int main() { int a, b; cin >> a >> b;
}
const string numbers[]={"one","two","three","four","five","six","seven","eight", "nine"}; int n1,n2; cin>>n1>>n2; for(int i=n1;i<=n2;i++) { if(i>=1 && i<=9){ cout<9){ cout<<(i%2==0?"even":"odd"<
`
include
include
using namespace std;
int main() { // Complete the code. int a,b; cin >> a >> b; string arr [] = {"one","two","three","four","five","six","seven","eight","nine"}; for(int i =a;i<=b;i++){ if(i<=9){ cout <
since it involved int and char type , i decided to solve it using switch statement, and it worked on all cases, i struggledd when i was dealng with "default" case cause i decided to jusst skip it first and use a nested if condition for greater then 9 condition but then i infused it in default case using ternary operator and it worked :)
include
include
using namespace std;
int main() { int n1,n2; cin >> n1 >>n2;
}