Arrays-Insertion-sort

why my test case two showing me no output. IDK
//Code
static Scanner sc = new Scanner(System.in);
public static void main(String args[]) {

	int n = sc.nextInt();
	if(n>1 && n<Math.pow(10,3)){
		int[] arr = new int[n];
		input(arr);
		sort(arr);
	}

}

public static void input(int[] arr){
	for(int i=0;i<arr.length;i++){
		arr[i] = sc.nextInt();
	}
}

public static void sort(int[] arr){

	for(int counter=1;counter<arr.length;counter++){
		int val = arr[counter];
		int i = counter-1;
		while(i>=0 && arr[i]>val){
				arr[i+1] = arr[i];
				i--;
			}
			arr[i+1] = val;
		}
	for(int i=0;i<arr.length;i++){
		System.out.println(arr[i]);
	}	
	}

}

Hi @dishant,
Array length can be between 1 and 1000. So, you need to have a equal to operator as well. Also there is no need of that condition. So might as well remove it.