C program for function of compound interest, C/C++ Programming

C Program for FUNCTION  OF COMPOUND INTEREST

float ci(float,float,float);

void main()

{

          float p=0,r=0,n=0,k=0;

          clrscr();

          printf("ENTER THE PRINCIPAL: ");

          scanf("%f",&p);

          printf("ENTER THE RATE OF INTEREST= ");

          scanf("%f",&r);

          printf("ENTER THE PERIOD= ");

          scanf("%f",&n);

          k=ci(p,r,n);

          printf("THE COMPUND INTEREST IS %f",k);

          getch();

}

float ci(float p,float r,float n)

 

{

          float k=0,t=0;

          for(t=1;t<=n;t++)

          {

                   k=(p*r)/100;

                   p=p+k;

          }

          return(k);

}

 

OUTPUT :

ENTER THE PRINCIPAL : 10000

ENTER THE RATE OF INT : 5

ENTER THE PERIOD : 10

THE COMPOUND INTEREST IS 775.664062

Posted Date: 9/10/2012 8:03:01 AM | Location : United States







Related Discussions:- C program for function of compound interest, Assignment Help, Ask Question on C program for function of compound interest, Get Answer, Expert's Help, C program for function of compound interest Discussions

Write discussion on C program for function of compound interest
Your posts are moderated
Related Questions
WAP TO PRINT THE LARGEST NUMBER FROM ANY 10 NUMBERS #include stdio.h> #include conio.h>   void main()   {                    int a[10],i,max;

a c program to find the volume of sphere

How can I handle a constructor that fails?

Develop a function to calculate sum of n even integers starting from a given even integer

Find out initial basic feasible solution for the given transportation problem using Least Cost Method (LCM).

need some help with finishing a program

Default Value Functions,  When declaring a function we can specify a default value for each parameter. This value will be used if that parameter is left blank when calling to the f

Use 16 digit credit card numbers that contain 15 digits an 1 check digit. The format of the card number consists of the 15 digits followed by the check digit. The check digit is co


for different operation multiple stack