How to prompt user enter 10 integer then sort it in both ascending and descending order and also ask user either they want to sort it by insertion sort or selection sort or bubble sort??

I would use c++ to prompt the user for 10 integers. Each entry could be stored in an array of integers.

At this point, you could display a menu of options on how the user would like to sort the array; which sorting method to use, and to sort either in acending or decending order.

You can then perform the various sorting algorithms on the array. After the desired sorting operation has taken place, you could probably display the newly sorted array contents.

Edited 7 Years Ago by Clinton Portis: n/a

A simple cout tag will produce a line on the screen. What exactly are you having an issue with? Post the code you have so far and then I can help.

A simple cout tag will produce a line on the screen. What exactly are you having an issue with? Post the code you have so far and then I can help.

i dunno how to write the coding o.....i try to find it....i am very poor in programming coding ...

i dunno how to write the coding o.....i try to find it....i am very poor in programming coding ...

Have you ever programmed in c++ before? You need to declare an array of size 10 and fill it using a for loop. Start trying to code this part, then you can try moving on to sorting.

i am very poor in programming coding ...

The only way to fix that is by writing code. It is best to start small and build on your achievements than to start with something too complex for your skills.

This article has been dead for over six months. Start a new discussion instead.