It has been given that y varies inversely with x, therefore the equation for this relationship is as follows;
y =

\
when y = -18 and x = 6
-18 = k/ 6 ---1)
We need to find x when y = 5
5 = k/x
when we divide 1)/2), k gets cancelled

x = -18*6/5
x = -21.6
when y = 5, then x = -21.6