Hi everyone!
As i have left my programming module to the last minute, I have been programming now for a few hours(literally) and I must say I am pretty damn good at it!
This is a program I need to tackle, it is a basic loan repayment thing.
I have corrected all the errors so now it runs, but how do i get it to stop on the remaining months?
you'll see what i mean when you run it:
Code:#include <stdio.h> #include <conio.h> int main() { float loan, rate, payment; int month=0; printf ("Amount of loan = "); scanf("%f", & loan); printf("Monthly interest rate = "); scanf("%f", & rate); printf("Payment per month = "); scanf("%f", & payment); while (loan>0.0) { month++; loan=loan+(loan*rate/100); loan=loan-payment; printf("In month %d the sum remaining is = %f\n", month, loan); } printf("It will take %d months to pay\n", month); getch(); }



LinkBack URL
About LinkBacks


