PPS Practical 3

PPS Practical 3
  • Aim: Write a program to calculate simple interest (i = (p*r*n)/100 ), i = Simple interest, p = Principal amount, r = Rate of interest, n = Number of years.
  • Code:
    //For turbo C++ remove below comments
    #include <stdio.h>
    //#include<conio.h>
    void main()
    {
        float i,p,r,n;
        //clrscr();
        printf("Enter Principal Amount : ");
        scanf("%f",&p);
        printf("Enter Rate of Interest : ");
        scanf("%f",&r);
        printf("Enter number of years : ");
        scanf("%f",&n);
        i=(p*r*n)/100;
        printf("Simple Interest is : %.2f",i);
        //getch();
    }
                    
  • Output:
  • Output of practical 3

Comments