Write a C program to find the Simple Interest. Take input for principle amount, rate of interest and time from terminal


Write a C program to find the Simple Interest. Take input for Principle Amount, Rate of Interest and Time from terminal.


Simple Interest is the money paid by the borrower to the lender, based on the Principle Amount, Interest Rate and the Time Period.

Simple Interest is calculated by, SI= P * T * R / 100 formula.

Where, P is the Principle Amount.
T is the Time Period.
R is the Interest Rate.

Definition of 'Simple Interest' from WEB

A quick method of calculating the interest charge on a loan. Simple interest is determined by multiplying the interest rate by the principal by the number of periods.
Simple Interest = P x I x N


Where:

P is the loan amount
I is the interest rate
N is the duration of the loan, using number of periods

Explanation of 'Simple Interest'

Simple interest is called simple because it ignores the effects of compounding. The interest charge is always based on the original principal, so interest on interest is not included.  This method may be used to find the interest charge for short-term loans, where ignoring compounding is less of an issue.

14 comments:

MAHADI HASAN said...

#include
#include
void main()
{
int p,t;
float r;
float SI;
printf("\nEnter the Principle Amount, Terms, Rate of Interest :");
scanf("%d%d%f",&p,&t,&r);
printf("\nThe Simple Interest for the Principle \nAmount %d for %d Years with an Interest of %0.2f",p,t,r);
SI=((p * t * r) / 100);
printf("\n is %5.0f.",SI);

getch();
}
By Mahadi.

A.K.M Ashrafuzzaman said...

printf("\n is %5.0f.",SI);

I think here some problem for out put show

A.K.M Ashrafuzzaman said...

#include
main()
{
int p,t;
float r;
float SI;
printf("\nEnter the Principle Amount,Time of period, Rate of Interest respectively:");
scanf("%d%d%f",&p,&t,&r);
SI=((p * t * r) / 100);
printf("\nInterest is: %.2f",SI);
getch();
}

modify by Ashraf

JavaScriptFlavour said...

I am so happy to see all above discussion. Keep it up.

JavaScriptFlavour said...

I am so happy to see all above discussion. Keep it up.

sourav mahmud said...

sir,i want to make the program in real use...try to make prompt program...here it is

#include
#include

main()
{
float si,p,i,t;
char ch;
si:
printf("enter your principle : ");
scanf("%f",&p);
printf("enter your time(in year) : ");
scanf("%f",&t);
printf("enter your interst rate : ");
scanf("%f",&i);
printf("you have entered,principle=%f\n time=%f year\n interst rate=%f\n",p,t,i);
printf("if your entered data is correct press 'y' , otherwise press 'n' : ");
scanf("%s",&ch);
if (ch=='y' || ch=='Y')
{
si=(p*i*t)/100;
printf("your simple interest is = %f",si);
}
else if (ch=='n'||ch=='N')
goto si;
getch();
}

A.K.M Ashrafuzzaman said...

Great....That's real programmer.

Mritunjoy Saha said...

#include
#include

main()
{
float si,p,i,t;
char ch;
si:
printf("enter your principle : ");
scanf("%f",&p);
printf("enter your time(in year) : ");
scanf("%f",&t);
printf("enter your interst rate : ");
scanf("%f",&i);
printf("you have entered,principle=%f\n time=%f year\n interst rate=%f\n",p,t,i);
printf("if your entered data is correct press 'y' , otherwise press 'n' : ");
scanf("%s",&ch);
if (ch=='y' || ch=='Y')
{
si=(p*i*t)/100;
printf("your simple interest is = %f",si);
}
else if (ch=='n'||ch=='N')
goto si;
getch();
}

Mritunjoy Saha said...

#include
#include
int main()
{
int num1,num2;
float res;
char opt;
calc:
printf("enter your value to calculate\n");
scanf("%d%c%d",&num1,&opt,&num2);

switch(opt)
{
case '+':res=num1+num2;
printf("=%f\n",res);
break;
case '-':res=num1-num2;
printf("=%f\n",res);
break;
case '*': res=num1*num2;
printf("=%f\n",res);
break;
case '%':res=num1%num2;
printf("=%f\n",res);
break;
case '/':(float)res=(float)num1/(float)num2;
printf("=%f\n",res);
break;
default : printf("error ! enter valid sign\n");
break;
}
goto calc;
getch();
return 0;
}

Mritunjoy Saha said...

i am so happy to do it !

Abhay Gautam said...

Very informative post indeed.. being enrolled in http://www.wiziq.com/course/6314-learn-c-programming-language-low-priced-student-edition was looking for such articles online to assist me.. and your post helped me a lot

mahmud tamim said...

#include
int main()
{
float a,b,c,si;
printf("\nEnter the amount: ");
scanf("%f",&a);
printf("\nRate: ");
scanf("%f",&b);
printf("\nTime: ");
scanf("%f",&c);
si=(a*b*c)/100;
printf("\nThe simple interest=%f",si);
}

Shahin Sheikh said...

#include
#include
main(){
int jama,suderhar,somoy;
int sud;
suderhar=suderhar/100;
scanf("%d",&jama);
scanf("%d",&suderhar);
scanf("%d",&somoy);
sud=jama*suderhar*somoy;
printf("%d",sud);
return 0;
}

Hasmot Ali said...

Md.Hasmot Hossen
ID:201421066

#include
#include
class interest
{
int n;
float rate,p;
public:
void get()
{
cout<<“\nEnter principle Amount & no. of year: \n”;
cin>>p>>n;
}
void cal(float rate)
{
float si;
si=(p*n*rate)/100;
cout<<“\n\nSimple Interest is: “<<si;
}
};
void main()
{
interest i;
clrscr();
i.get();
i.cal(4.5);
getch();
}