#include <iostream>
using namespace std;
void bubble_sort(int unsorted[],int length)
{
for (int i = 0; i < length; i++)
{
for (int j = i; j < length; j++)
{
if (unsorted[i] > unsorted[j])
{
int temp = unsorted[i];
unsorted[i] = unsorted[j];
unsorted[j] = temp;
}
}
}
}
void main()
{
int x[] = { 6, 2, 4, 1, 5, 9 };
bubble_sort(x,sizeof(x)/sizeof(x[0]));
for(int item : x)
{
cout<<(item);
}
cout << endl;
system("pause");
}
using namespace std;
void bubble_sort(int unsorted[],int length)
{
for (int i = 0; i < length; i++)
{
for (int j = i; j < length; j++)
{
if (unsorted[i] > unsorted[j])
{
int temp = unsorted[i];
unsorted[i] = unsorted[j];
unsorted[j] = temp;
}
}
}
}
void main()
{
int x[] = { 6, 2, 4, 1, 5, 9 };
bubble_sort(x,sizeof(x)/sizeof(x[0]));
for(int item : x)
{
cout<<(item);
}
cout << endl;
system("pause");
}