Explanation:
cost of 18 apples= 18x6p= 108p
£5-108p= x (will let it be x since i do not know the conversion)
maximum number of banana he can buy= x divide by 40p (rounded down to smallest whole number)= b
The change he have= x-(40×b) = y
apples bought with change= y divide by 6p= a
do the working above to find value for a and b, add a to the 18 apples bought initially and b is number of banana