From 632cb7849aaa242a07c3161dd5d885fd30588542 Mon Sep 17 00:00:00 2001 From: Siddhant96308 <116116880+Siddhant96308@users.noreply.github.com> Date: Thu, 20 Oct 2022 11:41:03 +0530 Subject: [PATCH] Create SIMPLE INTEREST.cpp I am adding a solution of simple interest in c++ languages. --- SIMPLE INTEREST.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 SIMPLE INTEREST.cpp diff --git a/SIMPLE INTEREST.cpp b/SIMPLE INTEREST.cpp new file mode 100644 index 0000000..f5aee5f --- /dev/null +++ b/SIMPLE INTEREST.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; +int main(){ + int p, t, r, SI; + + // Asking for input + cout << "Enter the principal amount: "; + cin >> p; + cout << "Enter the time period(in years): "; + cin >> t; + cout << "Enter the rate of interest: "; + cin >> r; + + // Calculating simple interest + SI = (p*r*t) / 100; + + // Displaying output + cout << "Simple Interest: " << SI << endl; + return 0; +}