Today I am going to tell you how to get Compound Interest with C program. It is not very difficult. Very simple and easy program.
However, Let's start our program. Open your Turbo C program and enter the following codes:
Then compile and run.
Thanks!
However, Let's start our program. Open your Turbo C program and enter the following codes:
#include <stdio.h>
#include <conio.h>
#include <math.h>
void main (){
float p, r, n, i, f;
clrscr ();
printf("Please enter a value for the principal (p) : );
scanf ("%f", &p);
printf("Please enter a value for the interest rate (r) : );
scanf ("%f", &r);
printf("Please enter a value for the number of Years (n) : );
scanf ("%f", &n);
i=r/100;
i=i+l
f=p*(pow (i,n));
printf ("\n The Final value (F) is : %. 3f",f);
getch ();
}
Then compile and run.
Thanks!
No comments:
Post a Comment