In this example, we will calculate simple interest. For calculating simple interest formula given below
Program to calculate Simple Interest in C
#include<stdio.h>
void main()
{
int p,r,t;
float si;
printf("Enter principal amount");
scanf("%d",&p);
printf("Enter rate of interest");
scanf("%d",&r);
printf("Enter Time in years");
scanf("%d",&t);
si = ( p*r*t ) / 100;
printf("Simple Interest = %.2f",si);
}
Output
Enter principal amount
50000
Enter rate of interest
12
Enter time
3
Simple Interest = 18000.00
Introduction of C and Hello World Program
C program to Addition of two numbers
C program to find Area of Triangle
C program to find Area of Circle
C program to find Area of Rectangle