well, let's notice something, a cube, all equal sides, has a side of 6, thus its volume is simply 6*6*6 = 216 cm³.
now, a rectangular prism, is a cuboid as well, but with varying dimensions.
let's notice something 6*6*6 is simply a multiplication of 3 numbers, let's then do a quick <u>prime factoring</u> of those numbers, well, 6 factors only into 2 and 3, so then the product of 6*6*6 can really be rewritten as (2*3)(2*3)(2*3).
well, regardless on how we rearrange the factors, the product will be the same, commutative property, so the rectangular prism will more or less have the same product and thus just about the same prime factors.
so let's rearrange on say hmmm height = 3 cm, length = 3*3 cm and width = 2*2*2 cm, notice, is still the same prime factors, 3*9*8 = 216 cm³.
Check the picture below.