Saturday, 5 September 2020

Program to calculate Simple Interest

  /*program to compute the simple interest*/

#include<stdio.h>

int main()

{

float P,T,R,INTEREST;


printf("Enter the principal:");

scanf("%f",&P);

printf("Enter the time:");

scanf("%f",&T);

printf("Enter the rate:");

scanf("%f",&R);

INTEREST=(P*T*R)/100;

printf("The interest amount is %.1f",INTEREST);

return 0;

}

OUTPUT

Enter the principal:1000
Enter the time:2
Enter the rate:2.4
The interest amount is 48.0

Description:

Here we ask the value of paramters to find SI and calculate it using formula.

No comments:

Post a Comment

If you have any doubt, please ask in the comment section.

Search This Blog

Program to print weather the number is happy or not.

#include <stdio.h> #include <math.h> int main () { int i , j , num , temp , sum = 0 ; printf ( "Enter number\n...