Q.1) Write a program that prompts the user to enter five words (using one cin statement), and store them in five variables, and then sort the words alphabetically

Recommended Answers

All 3 Replies

Do the assignment one small part at a time. First write a program that contains a loop which runs from 0 to 5. Then declare an array of 5 strings. Now your program is ready to prompt inside the loop for the strings, using the loop counter as the index into the array of strings.

Once you have finished that, you are ready for the next part of the assignment -- sorting the array of words. When you get that far, come back and we'll help you with it, assuming you still need help.

i need code in this question because do not download the program the c++

Sorry, but we don't do your homework for you... :-( Post your attempt to do the coding, and we may be able to help sort out your problems!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.