Question : Write a C Program to find the simple interest.
/*
Write a C Program to find the simple interest.
SI
=
(principle
* time
* rate
)
/
100*/
#include <stdio.h>
intmain()
{
float
principle
,time
,rate
,SI
;
/* Input principle, rate and time */
printf("Enter principle (amount): ");
scanf("%f",
&
principle
);
printf("Enter time: ");
scanf("%f",
&
time
);
printf("Enter rate: ");
scanf("%f",
&
rate
);
/* Calculate simple interest */
SI
=(
principle
*time
*rate
)/
100;
/* Print the resultant value of SI */
printf("Simple Interest = %f ",
SI
);
return (0);
}
OUTPUT :
Enter principle (amount): 1200
Enter time: 2
Enter rate: 5.4
Simple Interest = 129.600006
Thank you very much for reading carefully, if you have any other questions, you can share it with us through comments, if this information was important to you, please let us know through comments.
Please do comment and share.
Thank You.
No comments:
Post a Comment