If I scan 10 numbers, how I put them in increasing order?
If I scan 10 numbers, how I put them in increasing order?
There's a bunch of ways to do this, look up "sorting algorithms" on Wikipedia. The easiest is probably to do something like this:
Code:int numbers[10]; //Containing your numbers int min = numbers[0]; for(int i = 0; i < 10; i++) { for(int j = i; j < 10; j++) MIN(numbers[j], min); if(min != numbers[i]) //Swap the two with a temp variable }
We're not here to do your homework for you. Give it a shot and we will give help when you get stuck and have a specific question.
Of course you would have known this if you had read the Announcement at the top of the thread list.
If you understand what you're doing, you're not learning anything.
Y don't you give it a shot.. and come back with the problems.. you face.. rather than expecting us to do the homework.. ??
If your intestion is to learn.. then.. you need to change your ways.. !!
You type like William Shatner talks.
Quzah.
Hope is the first step on the road to disappointment.
Kirk: Spock - what is it?
Spock: It's code captain, but not as we know it.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.