Answer:
The formula is basically the same. For the square, we have to multiply
L x W (length x width) : SQUARE
And for the cube, it is kind of the same but there is the height also in it.
LxWxH (Length x width x height) : CUBE
Both of these shapes formula is basically the same, but because the cube is 3D, that's why there is height also in it, so it multiplies the height also to find the volume. While for the square, it's 2d, so there's just Length and Width to multiply with.
CONCLUSION:
The formula to find the square's and cube's volume is basically the same, except that for the cube, we have to multiply the height ALSO.