Why there is no need of return at end after if else as the method is of int type

static int search(int arr[], int l, int h, int key)
{

	if(l>h)
		return -1;
	
	int mid=(l+h)/2;
	
	if(arr[mid]==key)
		return mid;
	
	
	if(arr[l]<=arr[h])
	{
		if(arr[l]<=key && key>=arr[h])
		{
			return search(arr,l,mid-1,key);
			
		}
		return search(arr,mid+1,h,key);
	}
	else {
		
		if(arr[mid]<=key && key<=arr[h])
		{
			return search(arr,mid+1,h,key);
			
		}
		return search(arr,l,mid-1,key);
		
	} 

}

@pallavigoel1996 hey buddy, you see if if will not execute then else will for sure so you are basically returning something everytime right? So no need for unreachable extra return statement, i will suggest dry run for small input also.
If your doubt is clear mark it resolved and rate full else ask ya query bro!