please use c++, thank you!
Solved 1 Answer
See More Answers for FREE
Enhance your learning with StudyX
Receive support from our dedicated community users and experts
See up to 20 answers per week for free
Experience reliable customer service
Please find the code below: #include <iostream> #include<string.h> using namespace std; int main() { int start,end; string words[]={"one","two","three","four","five","six","seven","eight","nine"}; // storing the words in string array // taking input from user cin >> start; cin >> end; for(int i=start;i<=end;i++) { if(i<=9) cout << words[i-1] << endl; // when the number <= 9, print the words from the corresponding index in array else if(i%2==0) cout << "even" << endl; // printing "even" when divisible by 2 and number > 9 else cout << "odd" << endl; // printing "odd" when not divisible by 2 and number > 9 } return 0; } Code snapshot :#include <iostream〉#include〈string. h\rangleusing namespace std;int main(){int start, end;string words []=\{ "one", "two", "three", "four","five","six","seven", "eight", "nine" \}; // storing the words in string/l taking input from usercin \gg \operatorname{start;}cin \gg end;for (int i=s \operatorname{tar} t ; i<=e n d ; i++ ){if (i<=9)cout \ll words [\mathbf{i}-1] \ll end; / / when the number \ll=9, print the words from the corresponding index in arraelse iff(i%2==0)|cout << "even" << endl; // printing "even" when divisible by 2 and number >9elsecout < "odd" < endl; // printing "odd" when not divisible by 2 and number >9} Output snapshot: 711seveneightnineevenodd   ...