For this Question: Given a sorted array arr[] of n elements, check whether a given element x is present in arr[] or not.The first line contains a single integer N.
next line contains N space-separated integer arr[i]
next line contains a single integer target(k)

Constraints
1<=N<=10^5
1<=A[i]<=10^9Determine whether given number is present in array or not.Sample Input 1:
8
1 12 13 14 22 45 67 11123
14

Sample Output 1:
1
Explanation : 14 present at fourth index, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
int binarySearch(int arr[], int l, int r, int x)
{
	if (r >= l) {
		int mid = l + (r - l) / 2;
		if (arr[mid] == x)
			return mid;	
		if (arr[mid] > x)
			return binarySearch(arr, l, mid - 1, x);	
		return binarySearch(arr, mid + 1, r, x);
	}
	return -1;
}
int main()
{
	int n,x;
	cin>>n;
	int arr[n];
	for(int &i:arr)cin>>i;
	cin>>x;
	int result = binarySearch(arr, 0, n - 1, x);
	(result == -1)? cout <<0:cout <<1;
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?