@ramyani,
In the figure, the field will be different on the wires shown in red as the magnetic field is a function of 'x'.
@feynmann sir,
Q- The mag field existing in a region is given by B = Bo(1 + x/l)K {K is vectorial K showing that direction of field is along z-axis). A square loop of edge l and carrying a current i, is placed with its edges parellel to the X-Y axes. Find the magnitude of the net magnetic force experienced by the loop.