All pastes #165561 Raw Edit

Stuff

public text v1 · immutable
·published 2006-09-09 23:39 UTC
rendered paste body
/*A program to find compound interest*/

#include <stdio.h>
#include <math.h>

/*Declare variables*/

float balance, rate, future, years;
main()
{

/*Have the user input the values desired*/
/* for the presetnt balance, rate, and time*/

printf("\nEnter the opening balance: ");
scanf("%f",&balance);
printf("\nEnter the interest rate in percent per year:  ");
scanf("%f",&rate);
printf("\nEnter the number of years the balance is held:  ");
scanf("%f",&years);

/*Calculate the future balance using the formula*/

future = balance * (pow(2.7183,(rate/100)*years));

/*Print the results*/

printf("\nThe future balance is %f, future);
}