QBASIC – Total Surface Area of a sphere

Table of Contents

Program

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

REM Program to find total surface area of sphere
CLS
INPUT "Enter the radius: "; r
tsa = 4 * 3.14 * r ^ 2
PRINT "Total Surface Area of a sphere is: ";tsa
END

Output

Explanation

Let’s first see the formula: tsa = 4 * pi * r ^ 2, where the value of pi is 3.14. So, we can determine the total surface area of any sphere by taking the radius of the sphere from the user and multiplying the value of pi by 4 and the radius of the sphere raised to the power of 2.

More Programs

https://thinkshare.one/learn/programming/qbasic/

Leave a Comment

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

Exit mobile version