You must be working in the same units.
A key to many problems like this is that the units must cancel out correctly and if they do, your answer is likely to be correct.
In your case, you need to make sure that all three things (mass, volume, and density) have common units. You will need to convert the mass into grams so that your units will cancel out correctly when you do your division to get the volume in cm3.
You may see the same situation if your class has problems for velocity. Make sure the units agree.