
问题
编写一个C程序,计算存款金额在一些年后的增加利息
解决方案
计算利息的公式为 −
M=((r/100) * t);A=P*exp(M);
Where r= rate of interest
t=no. of years
立即学习“C语言免费学习笔记(深入)”;
P=amount to be deposited
M=temporary variable
A= Final amount after interest
算法
STARTStep 1: declare double variablesStep 2: read amount to be depositedStep 3: read rate of interestStep 4: read years you want to depositStep 5: Calculate final amount with interest I. M=((r/100) * t); II. A=P*exp(M);Step 6: Print final amountSTOP
示例
<!–
现场演示
–>
#include#include
输出
amount to be deposit in the bank: 50000enter the rate of interest:6.5How many years you want to deposit:5amount after 5.0 years with interest is:69201.53
以上就是C语言公式计算利息金额的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1444884.html
微信扫一扫
支付宝扫一扫