Given: mass of body A and body B =M
We know that,
ρ=MV
If both A and B are having the same mass, then density will only be dependent on volume.
ρ∝1V
Density is directly proporsional to 1V. Body A have a lesser volume comparatively body B. Then ρA will be greater than ρB