To enter principle amount, time, and rate of interest and to calculate and display simple interest and total amount.
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int y, m, t;
float p, r, si, tamt;
clrscr();
printf("Enter principal amount : ");
scanf("%f", &p);
printf("Enter rate of Interest : ");
scanf("%f", &r);
printf("Enter number of years and months :");
scanf("%d%d", &y, &m);
t = m + (y*12);
si = (p*t*r)/100;
tamt = p + si;
printf("Simple Interest : %.2f", si);
printf("\n Total Amount is : %.2f", tamt);
getch();
}
Previous Topic : To enter Radius of Circle and to calculate its Area.
No comments:
Post a Comment