JAVA SOLUTION

import java.util.*;
public class practice {

public static void main(String[] args) {
	//
	Scanner sc = new Scanner(System.in);
	int a[]= {9,8,10,0};
	
	 for(int i=0;i<a.length;i++) {          // to fetch 1st element of array
		 for(int j= i+1;j<a.length;j++) {   // to fetch 2nd element of array
			 if(a[j]<a[i]) {
				 int temp = a[i];
				 a[i]=a[j];
				 a[j]=temp;
			 }
		 }
		 System.out.println(a[i]);
	 }
		
	sc.close();

}}