NOTICE: I already solved the equation part of it and i just need some advice on making a table, I'm completely lost and just need some guidance.
I've been read around that i need to do a loop, but even from that i'm not sure what they mean. I just don't know where to start, any help would be appreciated.
Thank you.
Oh and for the table it just has to be two columns and the rows go until you reach 0 for the amount you owe on the loan.
#include <stdio.h>
int main()
{
int loanamt;
float YIP;
int monthlypay;
int amtofinterest;
printf("Enter the amount of the loan.\n");
scanf("%d", &loanamt);
printf("Enter the interest rate as a yearly percentage.\n");
scanf("%f", &YIP);
printf("Enter the amount of the monthly payment.\n");
scanf("%d", &monthlypay);
if(loanamt<0){
loanamt=0;
}
amtofinterest = (loanamt*((YIP/12.0)/100.0));
loanamt = loanamt+amtofinterest-monthlypay;
printf("you owe %d on your loan.\n", loanamt);