Calculation of interest on "C-language" deposit

Source: Internet
Author: User
Tags pow

Calculation of interest on deposits. There are 1000 yuan, want to save 5 years, according to the following 5 ways to Save://1, one deposit 5 years. 2, the first deposit 2 years, after the expiry of the principal and interest to save 3 years. 3, the first deposit 3 years, after the expiry of the principal and interest to save 2 years. 4, deposit 1-year period, after the expiry of the principal and interest after the 1-year period, the continuous deposit 5 times. 5, deposit current account. Current interest is settled once every quarter. 1-Year periodic interest: 4.14%;//2 periodic interest: 4.68%;//3 periodic interest: 5.4%;//5-year periodic interest: 5.85%;//Demand deposit interest: 0.72%; (demand deposit is settled once per quarter interest)//r--annual interest rate n--deposit years//1 years of this and: P = 1000* (1+r);//n-year principal and interest and: P = 1000* (1+n*r);//n/a 1-year deposit and principal: P = 1000* (1+r) ^n;//current deposit and interest: P = 1000* (1+R/4) ^4n--a quarter of interest and interest and #inclu  De <stdio.h> #include <math.h>int main () {double p1,p2,p3,p4,p5;double p0 = 1000.0;double R1 = 0.0414;double R2  = 0.0468;double R3 = 0.054;double R4 = 0.0585;double Huo = 0.0072;P1 = P0 * (1 + 5 * R4);p 2 = (P0 * (1 + 2 * r2)) *  (1 + 3 * R3);p 3 = (P0 * (1 + 3 * r3)) * (1 + 2 * r2);p 4 = P0 * POW ((1 + R1), 5);p 5 = p0 * POW (1 + HUO/4 );p rintf ("One deposit 5 years:%f\n", p1);p rintf ("Deposit 2 years, after maturity will be the principal and interest again 3 years:%f\n", p2);p rintf ("Deposit 3 years, after the expiry of the principal and interest again 2 years:%f\n", p3);p rintf ( "Deposit 1 years, after the expiry of the principal and interest to save 1 years, 5 consecutive times:%f\n", p4);p rintf ("Deposit current deposits. Current interest is settled quarterly:%f\n ", p5); return 0;} 

Calculation of interest on "C-language" deposit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.