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
write an algorithm to swap values without using third variable

A: Mostly can be overloaded. The only C operators which can't be are. and?: (and sizeof, that is technically an operator). C++ adds a few of its own operators, mostly which can be

write a c program that multiplies 3 martices

It is a pointer accessible only in the member functions of a struct, class or union type. It points to the object for which the member function is called. Static member functions d

basic salary of employees & calculate net salary in C++ Programming


Solve the Nine Queens problem recursively. The objective is to place nine queens on an empty chessboard so that no queen is “attacking” any other, i.e., no two queens are in the sa

write a c program to find input string using strlen(), strcpy(), strcat(),strncat(), strcmp().

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Problem: (a) What is the main advantage to using a data file? (b) What is meant by opening a data file? How is this accomplished? Illustrate your answer clearly with a sui