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
Employ operator () instead of operator[]. While you have multiple subscripts, the cleanest way to do it is along with operator () instead of with operator[]. The reason is that

Prepare data from fixed OCR areas scanned. Project Description: Project is to design software which can use character recognition only on certain areas of scanned pdf's/ jpeg

Problem : Luminous Jewels - Polishing Necklace Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of v

I have an exercise with 2 problems. One that is partially completed except with read problems with memory overwrite, and the other problem. I have enclosed the instructions documen


Define a user-defined data type (struct) called Car to represent a car in the context of a car dealership database. Car must have at least the following characteristics: Make Model

a program code for superposition of sine waves

Command-line arguments are passed into programs using the arguments of main(). Here's a quick example, for a program called by typing "progname file.txt 1 2.7": #include #incl

Define External Static Storage Class - Computer Programming? An external static is declared outside of all the functions and is obtainable to all functions in that program. The

Program is to search for a given character in a string: Program is to search for a given character in a string and print point of match char *stsearch(char *string, char sea