Check whether all the given numbers lies in range of x and y. You are given n inputs and two numbers x and y. Check whether all the given numbers lies in range of x and y. (x…