WAP that will take principal,rate and time as input and display the simple interest.
Program:
Program:
#include <stdio.h>
#include <conio.h>
#include <conio.h>
int main()
{
{
float p, r, si; //Declaring Variable.
int t; //Declaring Variable.
int t;
printf("Enter the values of p,r and t\n"); //For printing
scanf ("%f %f %d", &p, &r, &t); //For Input.
scanf ("%f %f %d", &p, &r, &t);
si = (p * r * t)/ 100.0; //Calculation
printf ("Rate = Rs. %5.2f%\n", r); //For printing
printf ("Time = %d years\n", t); //For printing
printf ("Simple interest = %5.2f\n", si); //For printing
getch(); //Getting a chracter or waiting for key press.
return 0;
printf ("Rate = Rs. %5.2f%\n", r); //For printing
printf ("Time = %d years\n", t); //For printing
printf ("Simple interest = %5.2f\n", si);
getch();
return 0;
No comments:
Post a Comment