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.
Source Code:

#include<stdio.h>
main()
{
    float jama,suderhar,somoy;
    float sud=0;
    printf("\nEnter Your Principal Amount: ");
    scanf("%f",&jama);
    printf("\nEnter Your Rate of Interest: ");
    scanf("%f",&suderhar);
    printf("\nEnter The Time Period: ");
    scanf("%f",&somoy);
    suderhar=suderhar/100;
    sud=jama*suderhar*somoy;
    printf("The calculated interest is: %f",sud);
    return 0;
}
<< Go to Index Page >>

68 comments:

  1. #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.

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

    I think here some problem for out put show

    ReplyDelete
  3. #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

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

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

    ReplyDelete
  6. 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();
    }

    ReplyDelete
  7. #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();
    }

    ReplyDelete
  8. #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;
    }

    ReplyDelete
  9. 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

    ReplyDelete
  10. #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);
    }

    ReplyDelete
  11. #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;
    }

    ReplyDelete
  12. 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();
    }

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

    ReplyDelete
  14. //*WAP a Program to find Simple Interest using constructor*//

    #include
    using namespace std;
    class interest
    {
    public:
    int p,t,r;
    int si;
    interest();
    ~interest();
    void S_interest();
    };
    interest::interest()
    {
    cout<<" ";

    }
    interest::~interest()
    {
    cout<<"destructing"<>p;
    cout<<"Enter the Time:"<>t;
    cout<<"Enter the Rate:"<>r;
    si=(p*t*r)/100;
    cout<<"The total simple interest is:"<<endl;
    cout<<si<<endl;
    }


    int main()
    {
    interest ob;
    ob.S_interest();
    return 0;

    }

    ReplyDelete
  15. #include
    using namespace std;
    class interest
    {
    public:
    int p;
    float t,r;
    interest();
    ~interest();
    void intrst();
    };
    interest::interest()
    {
    cout<<"Enter Principle Amount, Time(year) And Rate:";
    cin>>p>>t>>r;
    }
    interest::~interest()
    {

    }
    void interest::intrst()
    {
    float inter;
    inter=(p*t*r)/100;
    cout<<endl<<"Interest is: "<<inter<<"Tk";
    }
    main()
    {
    interest in;
    in.intrst();
    }

    ReplyDelete
  16. #include
    using namespace std;
    class arrmani
    {
    public:
    int len,i;
    int a[100];//Here is size but it is Fakibaji with compiler
    arrmani();
    ~arrmani();
    void leveling();
    void ev_oddchk();
    void show();
    void finder();

    protected:
    int o,e,osum,esum,allsum,count,p,q;
    float avg;
    };

    arrmani::arrmani()
    {
    cout<<"Array size?";
    cin>>len;
    cout<<"Enter array values: "<>a[i];

    }

    arrmani::~arrmani()
    {

    }

    void arrmani::leveling()
    {
    int b=5;
    while(b!=0)
    {
    b=0;
    int j=0;
    for(i=1;i=a[i])
    {
    p=a[j];
    a[j]=a[i];
    a[i]=p;
    b=1;
    }
    j++;
    }

    }
    cout<<"Leveled array is: ";
    for(i=0;ia[i])
    {
    q=a[i];
    }

    }
    }


    void arrmani::show()
    {
    cout<<"Number of value is: "<<count<<endl;
    cout<<"Total value is: "<<allsum<<endl;
    cout<<"Average value is: "<<avg<<endl;
    cout<<"Number of even value is: "<<e<<endl;
    cout<<"Summation of even value is: "<<esum<<endl;
    cout<<"Number of odd value is: "<<o<<endl;
    cout<<"Summation of odd value is: "<<osum<<endl;
    cout<<"largest value is : "<<p<<endl;
    cout<<"Smalest value is : "<<q<<endl;

    }

    int main()
    {
    arrmani an;
    an.leveling();
    an.ev_oddchk();
    an.finder();
    an.show();
    return 0;}

    ReplyDelete
  17. #include
    using namespace std;
    class arrmani
    {
    public:
    int len,i;
    int a[100];//Here is size but it is Fakibaji with compiler
    arrmani();
    ~arrmani();
    void leveling();
    void ev_oddchk();
    void show();
    void finder();

    protected:
    int o,e,osum,esum,allsum,count,p,q;
    float avg;
    };

    arrmani::arrmani()
    {
    cout<<"Array size?";
    cin>>len;
    cout<<"Enter array values: "<>a[i];

    }

    arrmani::~arrmani()
    {

    }

    void arrmani::leveling()
    {
    int b=5;
    while(b!=0)
    {
    b=0;
    int j=0;
    for(i=1;i=a[i])
    {
    p=a[j];
    a[j]=a[i];
    a[i]=p;
    b=1;
    }
    j++;
    }

    }
    cout<<"Leveled array is: ";
    for(i=0;ia[i])
    {
    q=a[i];
    }

    }
    }


    void arrmani::show()
    {
    cout<<"Number of value is: "<<count<<endl;
    cout<<"Total value is: "<<allsum<<endl;
    cout<<"Average value is: "<<avg<<endl;
    cout<<"Number of even value is: "<<e<<endl;
    cout<<"Summation of even value is: "<<esum<<endl;
    cout<<"Number of odd value is: "<<o<<endl;
    cout<<"Summation of odd value is: "<<osum<<endl;
    cout<<"largest value is : "<<p<<endl;
    cout<<"Smalest value is : "<<q<<endl;

    }

    int main()
    {
    arrmani an;
    an.leveling();
    an.ev_oddchk();
    an.finder();
    an.show();
    return 0;}

    ReplyDelete
  18. shah syed mohammad fehir Id:201520314

    #include
    using namespace std;
    int main()
    {
    int a,b;
    cout<<"please input the investment:";
    cin>>a;
    cout<<"please input the interest:";
    cin>>b;
    cout<<a+a*b/100;
    }

    ReplyDelete
  19. #include
    using namespace std;

    int main()
    {
    int period, principal;
    float inrate, interest;

    cout<<"What's the amount of your principal: ";
    cin>>principal;

    cout<>period;

    cout<>inrate;
    cout<<endl;

    interest=period*principal*inrate;

    cout<<"The total interest is: "<<interest;

    return 0;
    }

    ReplyDelete
  20. Appel mahmud akib. Id:201510384


    #include
    using namespace std;
    int main()
    {
    int p,t,r;
    cout<<"Input principal amount: ";
    cin>>p;
    cout<<"Input interest rate: ";
    cin>>r;
    cout<<"Input time: ";
    cin>>t;
    cout<<endl<<(p*t*r)/100<<endl;

    }

    ReplyDelete
  21. #include
    using namespace std;
    int main()
    {
    float far;
    cout<<"Input Temperature in farenheit: ";
    cin>>far;
    cout<<"Your temperature in celcius:(7.0/9.0) * (far-32)";
    }

    ReplyDelete
  22. #include
    using namespace std;
    int main()
    {
    int p,t,r;
    cout<<"Input principal amount: ";
    cin>>p;
    cout<<"Input interest rate: ";
    cin>>q;
    cout<<"Input time: ";
    cin>>t;
    cout<<endl<<(p*q*r)/100<<endl;

    }

    ReplyDelete
  23. using c++

    #include

    using namespace std;

    float func(float money, float interest, int time)
    {
    return ((money*time*interest)/100);
    }

    int main()
    {
    float i, j;
    int k;
    cout << "Enter total ammount --: ";
    cin >> i;
    cout << "Enter interest rate in (%) --: ";
    cin >> j;
    cout << "Enter your time for your money --: ";
    cin >> k;
    cout <<"The calculated interest is --: " << func(i, j, k);
    return 0;
    }

    ReplyDelete
  24. Using C++
    #include
    using namespace std;

    int main()
    {
    int i,t,a,sum;

    cout<<"Enter The amount";
    cin >>a;
    cout<<"Enter The interest";
    cin >>i;
    cout<<"Enter The time";
    cin >>t;
    sum =a*i*t/100;
    cout<<a*t*i/100<<sum;

    return 0;
    }

    ReplyDelete
  25. using c++

    #include
    using namespace std;
    int main()
    {
    int p,t,r;
    cout<<"Input principal amount: ";
    cin>>p;
    cout<<"Input interest rate: ";
    cin>>r;
    cout<<"Input time: ";
    cin>>t;
    cout<<endl<<(p*t*r)/100<<endl;

    }

    ReplyDelete
  26. #include
    using namespace std;

    int main()
    {
    double amount,interest,time, total;

    cout <<"Enter the amount: "<< endl;
    cin >>amount;
    cout <<"Enter the interest: "<< endl;
    cin >>interest;
    cout <<"Enter the time: "<< endl;
    cin >>time;
    interest = interest/100;
    total =(amount*interest*time);
    cout <<"The total interest is: "<<total<< endl;
    return 0;
    }


    id:201510992

    ReplyDelete
  27. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  28. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  29. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  30. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  31. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  32. #include
    main()
    {
    float jama,suderhar,somoy;
    float sud=0;
    printf("\nEnter Your Principal Amount: ");
    scanf("%f",&jama);
    printf("\nEnter Your Rate of Interest: ");
    scanf("%f",&suderhar);
    printf("\nEnter The Time Period: ");
    scanf("%f",&somoy);
    suderhar=suderhar/100;
    sud=jama*suderhar*somoy;
    printf("The calculated interest is: %f",sud);
    return 0;
    }

    ReplyDelete
  33. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  34. #include
    using namespace std;
    int main()
    {
    float m,s,t,i=0;
    cout<<"Enter Your Principal Amount: "<>m;
    cout<<"Enter Your Rate of Interest: " <>s;
    cout<<"Enter The Time Period: "<>t;
    s=s/100;
    i=m*s*t;
    cout<<"The calculated interest is: "<<i;
    }

    ReplyDelete
  35. #include
    int main(){
    int a,i,t,sum=0;
    printf("enter the amount=");
    scanf("%d",&a);
    printf("enter the interest=");
    scanf("%d",&i);
    printf("enter the time=");
    scanf("%d",&t);
    sum+=a*i*t/100;
    printf("%d",sum);
    }

    ReplyDelete
  36. #include

    main()

    {
    int a,b,result ;
    printf("Enter a: \n");
    scanf("%d",&a);

    printf("Enter b: \n");
    scanf("%d",&b);

    result = a*a+2*a*b+b*b;
    printf("The result of: %d",result);

    }

    ReplyDelete
  37. Summer 2017
    ID#201610042

    Answer to the Question No. 2:

    https://drive.google.com/file/d/0B99eePh0LV8gWnBJTnRXazlNVlk/view?usp=drivesdk

    ReplyDelete
  38. https://www.dropbox.com/s/dfb2awx0euj1km3/Simple_Interest02.cpp?dl=0

    ReplyDelete
  39. https://drive.google.com/file/d/0B0Llv4Ca9Ln6alZ3b2Z3ekVlTzg/view?usp=sharing

    ReplyDelete
  40. https://drive.google.com/open?id=0Bw0-FMVCC94QZlNNOGtncVdVdGc

    ReplyDelete
  41. ID : 201620195
    https://drive.google.com/open?id=0B9K31ospCyFjRjhISUU4UndWeXM

    ReplyDelete
  42. https://drive.google.com/open?id=0BzTqZMBWR6eOaWpJZEJQZzJyOWc

    ReplyDelete
  43. id no:201610259
    name: jahirul islam

    https://drive.google.com/open?id=0B8CpW2ga6ah0WTJXdWk5N29vRzA

    ReplyDelete
  44. https://drive.google.com/open?id=0B8369pAqjVVpd0QxR1ZJeHdEZjQ

    ReplyDelete
  45. https://drive.google.com/open?id=0B8369pAqjVVpd0QxR1ZJeHdEZjQ

    ReplyDelete
  46. wp. https://drive.google.com/open?id=0B8369pAqjVVpeHN5WG9sN3NTYWs

    ReplyDelete
  47. wp & rt.. https://drive.google.com/open?id=0B8369pAqjVVpTXRDaloxb2hvcnc

    ReplyDelete
  48. https://drive.google.com/open?id=0Byxq3aat_mNSVTJFbE1IN2V5SlU

    ReplyDelete
  49. ID 201610456
    Name MD USUF MIA
    https://drive.google.com/open?id=0B_PIGnOMR0K2a2N3QkoxazlpSEU

    ReplyDelete
  50. ID:201520552
    https://drive.google.com/open?id=0B5pG0kIjzgEKRm4zdzJoTkJoT3M

    ReplyDelete
  51. ID 201610456
    MD USUF MIA
    https://drive.google.com/open?id=0B_PIGnOMR0K2a2N3QkoxazlpSEU

    ReplyDelete
  52. 1.https://drive.google.com/open?id=0B7UQyRdu6h2wOHNxUGhsRkUyVUk

    ReplyDelete
  53. Id:201620318
    https://drive.google.com/open?id=0B2gcteJZycWoYUhNWkRtRWRsNm8

    ReplyDelete
  54. https://www.dropbox.com/s/llfu5v0onalxasa/HW2.cpp?dl=0

    ReplyDelete
  55. https://www.dropbox.com/s/cq4sotgxib8k82q/HW2%20paramiter.cpp?dl=0

    ReplyDelete
  56. https://www.dropbox.com/s/eun02fve1t51a3g/HW2%20constructor.cpp?dl=0

    ReplyDelete
  57. https://www.dropbox.com/s/kul1hqh8c8i1emu/account.cpp?dl=0

    ReplyDelete
  58. Id= 201710494
    https://www.dropbox.com/s/f9pp7byxe62mhis/prob%202.cpp?dl=0

    ReplyDelete
  59. https://drive.google.com/open?id=0B3bVD5Ppt_STN3YySkppUmxOTXc

    ReplyDelete
  60. ID : 201620128
    https://drive.google.com/open?id=0B0ZDK2wgeHVWdlQycVc4OWNtVlk

    ReplyDelete
  61. Nusrat Sumaiya AshrafeJune 8, 2017 at 8:33 AM

    ID: 201710950
    https://drive.google.com/open?id=0B1SMDOPeCkX_M01rNlVDOVk1a2s

    ReplyDelete
  62. https://www.dropbox.com/s/b0l64cd8y17q1ro/HW2.cpp?dl=0

    ReplyDelete
  63. https://drive.google.com/open?id=0B2Kd5YiufNdVUHVyVzlmdXIyS1U

    ReplyDelete
  64. https://drive.google.com/open?id=0BzKpnVbF4fc3QWhPd2FIQWpOVHc

    ReplyDelete
  65. ID:-201610058
    1.https://drive.google.com/open?id=0B7UQyRdu6h2wOHNxUGhsRkUyVUk

    ReplyDelete