LPU,NH-1 GT road, Jalandhar rohit.hero12@gmail.com +91-8437503569 https://www.facebook.com/rohit.adhikary3

P-Programming T-Technology A-And TI-Tips C-Cracking

Monday 20 April 2015

Compound interest

hello Reader,
This is the simple program in which we can calculate Compound Interest, where any user can give any value to it.
#include<stdio.h>  //standard library function
#include<conio.h>
int main()
{
int i,N;   // define variables
float P,R,sum=1,CI;  //define variables
printf("enter price\n");   //print what price user want to enter
scanf("%f",&P);
printf("enter rate\n");  //print what rate user want to enter
scanf("%f",&R);
printf("enter year\n");  //print for how many years user want to enter
scanf("%f",&N);
for(i=1;i<=N;i++)    //for loop from 1-N no
{
sum=sum*(1+(R/100));    // formula for calculating sum
}
CI=P*(sum-1);    //calculating Compound Interest
printf("compound interest=%f",CI);  //display the Compound Interest
getch();
return 0;
}

0 comments:

Post a Comment

Popular Posts

Recent Posts

Unordered List

Text Widget

Powered By Blogger
Powered by Blogger.

Contributors