19. Program
How to sort elements of array ? 12 5 7 2 1 78 6 This Will Be Convert Into 1 2 5 6 7 12 78
class Series9 { public static void main(String[] args) { int [] a = {12, 5, 7, 2, 1, 78, 6}; for (int i = 0 ; i < a.length ; i++) { for(int j = i ; j < a.length ; j++) { if(a[i] > a[j]) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } } } for(int i = 0 ; i< a.length;i++) { System.out.println(a[i]); } } }