QBASIC – Total Surface Area of Cube

Table of Contents

Program

Below is the QBASIC program to calculate the total surface area of a cube.

REM Program to find total surface area of a cube
CLS
INPUT "Enter the length: "; l
area = 6 * l ^ 2
PRINT "Total Surface Area of cube is: ";area
END

Output

Total Surface Area of cube QBASIC

Explanation

Let’s first see the formula:  Area = 6 * l ^ 2. So, we can determine the total surface area of a cube by taking the length from the user and multiplying the length raised to the power of 2 by 6.

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/

Leave a Comment

Your email address will not be published. Required fields are marked *