出于简单兴趣的C程序?

单利是本金,利率和持续时间(以年为单位)乘以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() {
   //本金
   float p = 5;
   //时间
   float r = 4;
   //年利率
   float t = 5;
   //单利
   float SI = 0;
   SI =(p * t * r) / 100;
   printf("Simple Interest = %f ",SI);
   return 0;
}

输出结果

Simple Interest = 1.0000