Computer Science, asked by sss544, 9 months ago

write a program to obtain principal amount,rate of interest nd time from uswr and compute simple interest .compunx interest=p[(l+r/100)n-1] SI=(p*n*r)/100 e=interest in percentage n=no of compunding periods for a year​

Answers

Answered by sadhu302
0

Answer:

#include<stdio.h>

#include<math.h>

float compoundInterest(float P, float T, float R) {

  return P*(pow(1+(R/100), T));

}

float simpleInterest(float P,float T,float R){

   return (P*T*R)/100;

}

int main() {

  float p, t, r;

  printf("Enter Princple amount, rate of interest, and time: ");

  scanf("%f%f%f", &p, &r, &t);

  printf("Compund Interest value: %f", compoundInterest(p, t, r));

  printf("Simple Interest value: %f",simpleInterest(p,t,r));

}

Explanation:

Similar questions