Saturday, October 8, 2011

C program to find Compound Interest using functions


Write a program to display Compound Interest for a given principal amount for 1 yr. Use function to find the interest....



Program..

#include<stdio.h>
#include<conio.h>
float ci(int p,float r);
void main()
{
int p;
float r,i;
clrscr();
printf("Enter the pricipal amount to find the compound interest of:");
scanf("%d",&p);
printf("\nEnter the rate:(r/100)");
scanf("%f",&r);
i=ci(p,r);
printf("\nThe interest for 1 yr: %f",i);
getch();
}

float ci(int p, float r)
{
float i;
i=(p*(1+r))-p;
return i;
}


Output...


1 comments:

Anonymous said...

Free Bonus No Deposit at Emperor Casino
Emperor Casino - Get a 100% up to €1000 Welcome Bonus on deccasino your 제왕 카지노 first deposit. Exclusive casino games and generous free bonuses. Rating: 샌즈카지노 4.3 · ‎7 votes

Post a Comment

About Me