Write a program to input the values of principal, rate and time and calculate simple interest ?
Program#include<stdio.h>
void main()
{
float p,r,t,si;
printf("\n Input the value of p = ");
scanf("%f",&p);
printf("\n Input the value of r = ");
scanf("%f",&r);
printf("\n Input the value of t = ");
scanf("%f",&t);
si=(p*r*t)/100;
printf("\n Simple interest = %.2 f",si);
}
void main()
{
float p,r,t,si;
printf("\n Input the value of p = ");
scanf("%f",&p);
printf("\n Input the value of r = ");
scanf("%f",&r);
printf("\n Input the value of t = ");
scanf("%f",&t);
si=(p*r*t)/100;
printf("\n Simple interest = %.2 f",si);
}
Output
Input the value of p = 5000
Input the value of r = 5
Input the value of t = 6
Simple Intrest = 1500.00
1 Comments
Awsome
ReplyDeleteIf You Have Any Doubt, Please Let Me Know,