May 08, 2019

C Program To Calculate Simple Interest

The following is a C Program to Calculate Simple Interest on screen after taking input from the user. Let's get started.

Calculate Simple Interest
Calculate Simple Interest

Overview:


Commands

scanf() function is used to obtain input and printf() function is used to print the string on the screen.

Program

#include<stdio.h>
#include<conio.h>
void main()
{
     float p,r,t,si;
     clrscr();
     printf("Enter Principal(p), Rate(r) and Time(t):\n");
     scanf("%f%f%f",&p,&r,&t);
     si=(p*r*t)/100;
     printf("The Simple Interest(SI) on Rs. %.2f at %.2f percent p.a. \nfor %.0f years is Rs. %.2f",p,r,t,si);
     getch();
}


Output

Simple Interest Output
Simple Interest Output

All programs compiled in this post are compiled in AnDOSBox.

Books I Prefer:






I hope this article was helpful to understand Calculate Simple Interest! Comment below, if you've got any question. Head back soon for another interesting article on C Programming.