/* The following code will calculate the simple interest based on the formula (p*r*t)/100. Where p=principle, r=rate per annum & t=time in years. Principle, Rate & Time elapsed will be asked to the user. */
//CODE:-
#include<stdio.h>
#include<conio.h>
void main()
{
float p,r,t,si;
printf("Enter Principal(Rupee), Rate(% Per Annum) and Time(Years):");
scanf("%f%f%f",&p,&r,&t);
si=(p*r*t)/100;
printf("\nSimple Interest= Rs. %f",si);
getch();
}
Screenshot:
//CODE:-
#include<stdio.h>
#include<conio.h>
void main()
{
float p,r,t,si;
printf("Enter Principal(Rupee), Rate(% Per Annum) and Time(Years):");
scanf("%f%f%f",&p,&r,&t);
si=(p*r*t)/100;
printf("\nSimple Interest= Rs. %f",si);
getch();
}
Screenshot:
C / C++ program to calculate simple interest |
0 comments:
Post a Comment