to extract the functions already created in file . float si,tim,amount,rot creates float type
variables which stores simple interest ,time,amount & rate of interest given by user .
simple interest = (amount*rot*time) which is stored in si .
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Program for Simple Interest.
#include<stdio.h>
#include<conio.h>
void main()
{ float si,tim,amount,rot;
clrscr();
printf("\n program to calculate simple interest");
printf("\n\n enter principal amount : ");
scanf("%f",&amount);
printf("enter rate of interest : ");
scanf("%f",&rot);
printf("enter time period : ");
scanf("%f",&tim);
si = (amount*tim*rot)/100;
printf("\n simple interest = %f",si);
getch();
}

No comments:
Post a Comment
Guys if you think something is wrong or should be edit than please do comment.