#include<iostream>
#include<iomanip>
int main()
{
constint arraySize = 10; // sets the array size
int myArray[arraySize] = {37, 89, 12, 8, 10, 4, 6, 68, 45, 2};
int hold; // the location to swap array elements
std::cout<<"Data items in original order\n";
for( int i = 0; i < arraySize; i++)
std::cout<<std::setw(4)<<myArray[i];
//loop to control number of passes
for( int i = 1; i < arraySize -1 ; i++)
{
for ( int j = 0;j< arraySize -1 ; j++ );
{
if( myArray [ j ] > myArray [ j+1 ] ) //compare and swap the elements
{
hold = myArray[ j ];
myArray[ j ]=myArray[ j+1];
myArray[ j+1] = hold ;
}
}
}
std::cout<<" Data items in ascending order\n";
for(int k = 0 ; k < arraySize ; k++ )
std::cout<<std::setw(4)<< myArray[k]
<<std::endl;
}// end main