QBASIC – Total Surface Area of a hemisphere

Table of Contents

Program

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

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

Output

total surface area of a hemisphere QBASIC

Explanation

Let’s first see the formula: tsa = 3 * pi * r ^ 2, where the value of pi is 3.14. So, we can determine the total surface area of any hemisphere by taking the radius of the hemisphere from the user and multiplying the value of pi by 3 and the radius of the hemisphere 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 *