The mass density or density of a substance is the ratio of mass of a substance to its volume. In this case, the mass of the iron is 39.5 g and its volume is 5 cm^3. Thus, the density of iron is:
density = mass/volume = 39.5/5 gm/cm^3 = 7.9 g/cm^3.
The same can also be expressed in terms of kg/lt as 7.9 kg/lt or in terms of kg/m^3 as 7900 kg/m^3.
Another parameter of interest, along with density, is the specific gravity of a substance. This is defined as the ratio of the density of a substance to that of a reference fluid (typically water). In case of iron, the specific gravity is 7.9, that is, iron is 7.9 times heavier than the water. In comparison, mercury has a specific gravity of 13.6.
Hope this helps.