(a):
#include<stdio.h>
int main()
{
int P=5000;
float T=2.5, R=5.5, interest;
interest=(P*T*R)/100;
printf("The deposited principal is Rs. %d\n",P);
printf("The time period is %.2f\n",T);
printf("The interest rate is %.2f percentage.\n",R);
printf("The intereset amount is Rs. %.2f\n",interest);
printf("The total amount is Rs. %.2f",P+interest);
}
===============================================================
(b):
#include<stdio.h>
int main()
{
float P, T, R, interest;
printf("Enter the Principal amount deposited\t");
scanf("%f",&P);
printf("Enter the Time period of deposition (in year)\t");
scanf("%f",&T);
printf("Enter the Rate of interest\t");
scanf("%f",&R);
interest=(P*T*R)/100;
printf("================================================\n");
printf("The principal amount deposited is Rs. %.2f\n",P);
printf ("The amount is deposited for %.2f years\n",T);
printf("The interest is %.2f percent\n",R);
printf("The intereset amount is %f\n",interest);
printf("The total amount is %f",P+interest);
}
No comments:
Post a Comment