• Breaking News

    A package for professionals

    C Program To Calculate Interest.(Interest Calculator)


    Here is the simple C Program To Calculate Interest.




    Question:
    (Interest Calculator) The simple interest on a loan is calculated by the formula
    interest = principal * rate * days / 365;
    The preceding formula assumes that rate is the annual interest rate, and therefore includes the
    division by 365 (days). Develop a program that will input principal, rate and days for several
    loans, and will calculate and display the simple interest for each loan, using the preceding formula.

    Source Code:

    #include <stdio.h>
    #include <stdlib.h>

    int main()
    {
        int term;
        float principal,rate,interest;
        while (term>=0){
        printf("Enter loan principal (-1 to end): ");
        scanf("%f",&principal);
        if (principal==-1)
            break;
        printf("Enter interest rate: ");
        scanf("%f",&rate);
        printf("Enter term of the loan in days: ");
        scanf("%d",&term);
        interest = principal * rate * term / 365;
        printf("The interest charge is $%.2f\n",interest);
        }
        return 0;

    }

    Note:

    Any Question!!??
    "Feel Free To Ask In Comments"
    Like and Share or Follow us on Facebook and Instagram for more Programs Codes ;).
    Email Us or inbox us to get Your Programs done :)

    No comments:

    Post a Comment

    Our Aim

    About