You are viewing a single comment's thread. Return to all comments →
No need for any if statements:
int n; const char *words[] = {"one","two","three","four","five","six","seven","eight","nine"}; cin >> n; cout << ((n<= 9) ? words[n-1] : "Greater than 9") << endl;
Seems like cookies are disabled on this browser, please enable them to open this website
Conditional Statements
You are viewing a single comment's thread. Return to all comments →
No need for any if statements: