Based on the definition of a volume, you have:
Volume of a cube:
[tex]V=a\cdot a\cdot a=a^3[/tex]where a is the length of the side of the cube.
Volume of a triangular prism:
[tex]V=\frac{1}{2}b\cdot h\cdot l[/tex]where b is the base, h is the height and l the length.