QBASIC – Calculate simple interest and the total amount

Table of Contents

Overview

Below is the QBASIC program to calculate the simple interest and the total amount given the principal amount, time and rate of interest.

REM Program to find simple interest and total amount
CLS
INPUT "Enter the principal: "; p
INPUT "Enter the time: "; t
INPUT "Enter the rate of interest: "; r
si = (p * t * r)/100
amount = si + p
PRINT "The simple interest is: ";si
PRINT "The total amount is: ";amount
END

Output

Simple Interest QBASIC

Explanation:

Let’s first see the formula of simple interest: si = (p * t * r)/100. So, we can determine the simple interest by taking the principal, time, and rate from the user and dividing the product of the principal, rate, and time by 100.

Finally, the total amount is the sum of simple interest and principal amount (amount = si + p).

More Programs

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

Leave a Comment

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