Heres something i whipped up in a hurry...
This uses the Bubble Sort method found (related links)
#include <iostream>
using namespace std;
int main(int argc, const char* argv)
{
int arraysize = 5; //Unsorted array size
int array [] = { 5, 3, 4, 2, 1 }; //The array of numbers itself
//Display the unsorted array
cout << "Before: {";
for (int c=0; c <= arraysize; c++)
{
cout << array[c];
if (c != arraysize)
{
cout << ",";
}
}
cout << "}" << endl;
//Acctually sort the array
int tmp=0; //Used for swaping values
for (int loop=0; loop <= (arraysize - 1); loop++)
{
for (int c=0; c <= (arraysize - 1); c++) //The sort loop
{
if (array[c] > array[c + 1])
{
//Swaps the two values in the array
tmp = array[c];
array[c] = array[c + 1];
array[c + 1] = tmp;
//Cleanup
tmp = 0;
}
}
}
//Display the sorted array
cout << "After: {";
for (int c=0; c <= arraysize; c++)
{
cout << array[c];
if (c != arraysize)
{
cout << ",";
}
}
cout << "}" << endl;
return 0;
}
sorry
draw a flow chart to arrange 3 numbers in ascending order
Ascending order is when numbers are arranged from the smallest to the largest. Descending order is when numbers are arranged from the largest to the smallest.
addends
This is known as arranging the numbers in ascending order.
Arrange the numbers in ascending order, and then take the mean of the fourth and fifth number.
When you are given some numbers just arrange them in ascending order and you will the smallest number which can be made out of those given numbers.
In ascending order: 2.8, 8.02, 8.2, 22.8, 28.2
4.78 4.8 4.89 4.9 are the numbers arranged in ascending order.
From ascending order, the numbers will be:0 , 0.01 , 0.1 , 1.0
its arranged by ascending and descending order.........
5