public class Test
{
public static void main(String args[])
{
int[] arr = {4, 1, 2, 6, 3, 8, 9, 10, 7, 5};
for (int i = 0; i < 10; i++)
System.out.print(arr[i] + " ");
System.out.println();
for (int i = 0; i < 10 - 1; i++)
for (int j = 0; j < 10 - 1 - i; j++)
{
if (arr[j] > arr[j + 1])
{
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
for (int i = 0; i < 10; i++)
System.out.print(arr[i] + " ");
}
}