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 read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.
After understanding this example, try to rewrite the same program without looking at the code. Then change some values or logic and run it again. This helps improve confidence and keeps learners engaged on the page for longer.