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
|
1610 Discussions
|
Please Login in order to post a comment
include
using namespace std;
int main() { int a, b;
}
include
include
using namespace std;
int main() { // Complete the code. int n; int a,b; cin>>a>>b; cin>>n;
} return 0; }
include
include
using namespace std;
int main() { // Complete the code. string a[9] = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}; // Declare the start number and end number int start, end; cin >> start >> end; // Declare a loop for with n for(int n = start; n <= end; n++){ if (1 <= n && n <= 9){ cout << a[n-1] << endl; } else if(n > 9){ if (n % 2 == 0){ cout << "even" << endl; } else{ cout << "odd" << endl; } } }
}