We can find the volume of the above figure by dividing the composite figure into unit cubes and adding the volumes.
The above composite figure can be divided into two smaller cuboids (one small cuboid on the top and the other at the bottom).
The bigger cuboid on the bottom has 6 unit cubes each in 3 layers, so 6×3=18 cm3
The small cuboid on the top has two unit cubes. So, the volume is 2 cm3.
∴ Volume of the cube =18+2=20 cm3