program to calculate the simple interest.


/*Program to calculate the simple interest .principal
amount ,rate ,and time enter by the user.*/
#include <stdio.h>
#include <conio.h>

int main()
{
    float p, r, t, si;
    printf("Enter the principal amount :\n");
    scanf("%f", &p);
    printf("Enter the rate :\n ");
    scanf("%f", &r);
    printf("Enter the duration of time in year:\n");
    scanf("%f", &t);
    si = (p * r * t) / 100;
    printf("Simple Interest :%.2f", si);
    return 0;
}
output
Enter the principal amount : 9000 Enter the rate : 3.5 Enter the duration of time in year: 2 Simple Interest :630.00
****** Thank you ******

Comments

Popular posts from this blog

18 Amazing programs in C.