Help wanted for my little program

Hi everyone!

I am a beginner in c programming, and I would be very very grateful if someone coule take a look at my little program which I wrote and which unfortunately does not really work.

The program calculates the running time and the annuity of a credit, after receiving the necessary values.
However, the formula for the running time does not work. I tried to rewrite this formula, maybe I have made a mistake:
in my programm n is the running time, R is the annuity, S is the amount of the credit, m is the fixed fee and i is the lending rate in per cent.


double R,m,S,i;

double annuity()
double R = 12*m;
return R;

int term()
int n = -(log(1-(i*S/R))/log(1+i));
return n;

Fill in a value for S: ");
Fill in a value for m: ");
Fill in a value for i: ");


The annuity is %.2lf",annuity());
The running time is %i

", term());

Thank you in advance and sorry for my bad english!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!