What is wrong in my code?

Scanner sc = new Scanner(System.in);
int n = sc.nextInt();

	int[] arr = new int[n];
	for(int i =0; i <n;i++) {
		arr[i] = sc.nextInt();
	}
	
	int num = sc.nextInt();
	
	//Binary Search
	int low= 0;
	int high=n-1;
	
	int mid = (low+high)/2;
	
	if(arr[mid]<num) {
		low=mid+1;
	}
	else if(arr[mid]>num) {
		high= mid-1;
	}else if(arr[mid]==num) {
		
		System.out.println(mid);
	}else {
		System.out.println("Not Found");
	}

debug for this:
5
3
4
5
1
2
2
Correct output:
4

Unable to debug it can you help me out what i have to change in my code ?

watch this:
https://www.youtube.com/watch?v=QOVBnzPgFYY