int binarySearch(int arr[], int len, int num)
{
int start = 0;
int end = len - 1;
while (start <= end)
{
start = middle + 1;
}else if (num < arr[middle])
{
end = middle - 1;
}
else
{
return middle;
}
}
return -1;
}
{
int start = 0;
int end = len - 1;
while (start <= end)
{
int middle = (start + end) / 2;
{
start = middle + 1;
}else if (num < arr[middle])
{
end = middle - 1;
}
else
{
return middle;
}
}
return -1;
}