Demo entry 6781651

aa

   

Submitted by anonymous on Jan 04, 2019 at 13:34
Language: C. Code size: 545 Bytes.

#include <stdio.h>
int main(void)
{
    float l,r,p,lr1,lr2,lr3;
    printf("Enter amount of loan: ");
    scanf("%f",&l);
    printf("Enter interest rate: ");
    scanf("%f",&r);
    printf("Enter monthly payment: ");
    scanf("%f",&p);
    r=r/(100*12);
    lr1=l+l*r-p;
    lr2=lr1+lr1*r-p;
    lr3=lr2+lr2*r-p;
    printf("Balance remaining after first payment:$%.2f\n",lr1);
    printf("Balance remaining after second payment:$%.2f\n",lr2);
    printf("Balance remaining after third payment:$%.2f\n",lr3);
    return 0;
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).