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
Problem: (a) (i) What is a structure? (ii) How does a structure differ from an array? (b) Declare a structure, called account, that will contain the following data me

The files are meteorological radar data whose decompression is badly needed for relative study. Please contact Kathy Lee (Email: ; Cell phone: 0086 15701799056) or Mr. Zhu (Email:


Write a function that computes f(x) for a quadratic polynomial in x, such as the one in assignment 3. Use the function to plot f(x) from -10 to +10.

Available in the string.h header file are the following routines         strcat(string1,string2);   This joins string2 to string1; care must be taken to allocate enough space for

I want to take 1.1 as input but when I am declaring it as float the output is given as 1.1000000

What are all of the implicit member functions of the class? Or what are all of the functions that compiler implements for us if we don't describe one? A: 1.      copy ctor

one of the segments is showing compilation error...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

what is an array?