how to make a program in c++[using Array] that ask the user to input 9 letters and arrange it in alphabetical order. thanks!

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

how to make a program in c++[using Array] that ask the user to input 9 letters and arrange it in alphabetical order. thanks!

Computer Science
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

#include #include using namespace std; int main() { string str = ""; cout << "input : "; cin >> str; { for(int i = 0; i < str.size(); i++) { for(int j = i + 1; j < str.size(); j++) { if(str[i] > str[j]) { char temp = str[i]; str[i] = str[j]; str[j] = temp; } } } cout << "output: " << str << "\n"; } }
Here's an implementation that's more specific (it uses an array of characters, not a string object): http://ideone.com/LqqJgD
when i tried your program the output is equal to the imputed char. the program should arranged the imputed char in to alphabetical order.??

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Whose program?
The code you posted. when i started debugging it works fine. but when i started imputing letters the output didn't satisfies the problem. it did not arrange the imputed letters into alphabetical order. it only prints the first char imputed.i don't know what's wrong with it.
The code is working correctly with the Ideone compiler. Perhaps your input is incorrect?

Not the answer you are looking for?

Search for more explanations.

Ask your own question