#include <iostream>
#include<time.h>
using namespace std;

void main (void)
{
	int i, list[10], swapped=1, temp;
	
	srand ((unsigned) time(NULL));

	for (i=0; i<10; i++)
	{
		list[i] = rand()%20 + 1;
	}
	for (i=0; i<10; i++)
	{
		cout << list[i] << endl;
	}
	
	while (swapped == 1)
	{
		swapped = 0;
		for (i=0; i<9; i++)
		{
			if (list[i] > list[i+1])
			{
				temp = list[i];
				list[i] = list[i+1];
				list[i+1] = temp;
				swapped = 1;
			}
		}
	}
	cout << "In ascending order : "<< endl;
	for (i=0; i<10; i++)
	{
		cout << list[i] << endl;
	}
}