ดอกเบี้ยแบบง่ายเป็นผลคูณของเงินต้น อัตราดอกเบี้ย และระยะเวลา (เป็นปี) คูณ 100
ตัวอย่าง
ป้อนข้อมูล − p=5, r=4, t=5
ผลผลิต − 1
คำอธิบาย:ดอกเบี้ยธรรมดา =(จำนวนเงินต้น * อัตราดอกเบี้ย * จำนวนปี) / 100
SI= 5*4*5/100 = 1
ตัวอย่าง
#include<iostream>
#include <stdio.h>
using namespace std;
int main() {
//principle amount
float p = 5;
//time
float r = 4;
//rate in years
float t = 5;
// Simple interest
float SI = 0;
SI =(p * t * r) / 100;
printf("Simple Interest = %f ",SI);
return 0;
} ผลลัพธ์
Simple Interest = 1.0000