Powered By Blogger

Friday, December 24, 2010

C Program to find the Simple Interest

/* C Program to Calculate and Display the Simple Interest of the Principal,
Time in years and the Annual Rate of Interest from user */

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

int main()
{
    int principal;
    int time;
    int rate;
    float simpleinterest;
    printf("Enter the Principal Amount\n");
    scanf("%d",&principal);
    printf("Enter the Time in years\n");
    scanf("%d",&time);
    printf("Enter the Annual Rate of Interest\n");
    scanf("%d",&rate);
    simpleinterest=(principal*rate*time)/100;
    printf("The Simple Interest is %f\n",simpleinterest);
    return 0;
}

No comments:

Post a Comment