Table of Contents
Program
Below is the QBASIC program to calculate the volume of a cube.
REM Program to find volume of a cube
CLS
INPUT "Enter the length: "; l
volume = l ^ 3
PRINT "Volume of cube is: ";volume
END
Output
![Volume of a cube QBASIC](https://thinkshare.one/wp-content/uploads/2021/08/Volume-of-a-cube-QBASIC.png)
Explanation
Let’s first see the formula: Volume = l ^ 3. So, we can determine the volume of a cube by taking the length from the user and raising the power of length by 3 or calculating the cube of length (l ^ 3).
Note: All sides are equal in a cube, hence only ask the length of a cube from the user.
More Programs
https://thinkshare.one/learn/programming/qbasic/