c program for function of compound


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

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: c program for function of compound
Reference No:- TGS0159429

Expected delivery within 24 Hours