int main()
{
int arr[5] = { 4, 5, 1, 0, 1 };
sort( arr, arr+5 );
cout<< lower_bound( arr, arr+5, 3 ) - arr <<endl;
return 0;
}
3 is not present inside the array and it’s and according to the code it helps to find the first occurrence of 3 but 3 is not present so according to me it should print 0, but it is printing 3.Can’t understand the logic please help.