Code Scrappers


Compound Interest C program


              #include<stdio.h>
              #include<stdlib.h>
              #include<math.h>

              void main()
              {
                  float principle, rate, time, CI;

                  printf("Enter the principle amount: \n");

                  scanf("%f", &principle);

                  printf("Enter the time duration: \n");

                  scanf("%f", &time);

                  printf("Enter rate of interest: \n");

                  scanf("%f", &rate);

                  CI = principle* (pow((1 + rate / 100), time)) - principle;

                  printf("The Compound Interest is %f\n", CI);

              }

          



Output

    Enter the principle amount:
    1000

    Enter the time duration:
    2

    Enter rate of interest:
    5

    The Compound Interest is 102.499901