Monday, 15 June 2015

C program for Calculating Simple interest

WAP that will take principal,rate and time as input and display   the simple interest.
   Program:

#include <stdio.h>
#include <conio.h>
int main()
{
   float p, r, si;  //Declaring Variable.
   int t;  
//Declaring Variable.


   printf("Enter the values of p,r and t\n");   //For printing
   scanf ("%f %f %d", &p, &r, &t);  
 //For Input.
     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;
}
Output:
Video Explanation
Sorry Guys Explanation of this tutorial will be posted later this month.


No comments:

Post a Comment