#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void
main ()
{
int i, j, n, temp;
int a[20];
printf ("Enter the size of array\n");
scanf ("%d", &n);
printf ("Enter the elements of an array\n");
for (i = 0; i < n; i++)
{
scanf ("%d", &a[i]);
}
printf (" the elements of an array before sorting are:\n");
for (i = 0; i < n; i++)
{
scanf ("%d\t", &a[i]);
}
for (i = 0; i <= n - 1; i++)
{
for (j = 0; j < n - 1; j++)
{
if (a[j] > a[j + 1])
{
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}
}
printf ("the elements of an array after sorting are:\n");
for (i = 0; i < n; i++)
{
scanf ("%d", &a[i]);
}
}