I still don't know much about how to incorporate functions. I look in my textbook and at my class notes but still no progress. Here's what I have with functions or parameters. It's not quite finished but maybe you can help me critique what I have thus far. The program I have to write is on my first post.
Code:
#include <stdio.h>
int main (void)
int amount, yrinterest, monthly;
float beginningbalance, principal, newamount, interest, payment;
printf ("Enter loan amount : ");
scanf ("%d", &amount);
printf ("Enter yearly interest rate: ");
scanf ("%d", &yrinterest);
monthly = yrinterest/ 12;
yrinterest = amount * monthly;
printf ("Enter monthly payment: ");
scanf ("%d", &monthly);
If yrinterest >= monthly
printf ("Monthly payment is too small.");
scanf ("%d", &monthly);
printf ("Enter monthly payment:");
Printf("Loan Repayment Table");
beginningbalance=1
While (beginningbalance > payment) {
Principal = Payment - Interest;
Newamt = Amount - Principal;
Printf ("Beginning Balance \t%f", beginningbalance);
Printf ("Payment \t%f", amount);
Printf ("Interest \t %f", interest);
Printf ("Principal \t %f", principal);
Printf ("Ending Balance \t %f", newamt);
amount=newamt;
beginningbalance=beginningbalance +1;
}
Payment = amount + interest;
Interest = amount * monthly;
return 0;
}
[EDIT]For what it's worth... code tags added by Hammer.