Help with a couple compiler errors
Greetings,
I'm kind of new to the C language and I had to write a program that computes a monthly payment. I'm using the gcc compiler and when I run the compile, I get the following messages:
loan.c: In function "int main":
loan.c:34: error: too few arguments to function 'pow'
Any ideas? Here is my code:
Code:
/*
Filename: loan.c
Description: The monthly payment for an installment loan.
*/
#include <stdio.h>
#include <math.h>
int main()
{
/* memory allocation for data */
double monthlypayment;
double principal;
double rate;
int months;
/* prompt user for data */
printf ("Enter the principal amount of the loan:");
scanf ("%lf",& principal);
printf ("Enter the yearly interest rate (eg.0.05):");
scanf ("%lf",& rate);
printf ("Enter the total number of payments in months:");
scanf ("%d",& months);
/* compute monthly payment */
monthlypayment = principal*(rate/12)/1-pow(1+rate/12)-months;
/* display result */
printf ("Your monthly payment will be: $%lf/n",monthlypayment);
/* End */
return 0;
}