Program to find the simple interest.
In this program you will learn how to find the simple interest. Lets first understand the concept of simple interest then we will write our code.
In this program you will learn how to find the simple interest. Lets first understand the concept of simple interest then we will write our code.
#include"stdio.h"
void main()
{
// variable declaration
int p,r,t,si;
// take values from user
printf("enter principle, Rate of interest & time to find simple interest:\n ");
scanf("%d%d%d",&p,&r,&t);
// Calculate simple interest
si=(p*r*t)/100;
// Print result
printf("simple intrest= %d\n",si);
}
enter principle, Rate of interest & time to find simple interest:
1000 8 2
simple intrest= 160
Press any key to continue . . .
First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.
Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.