Write a program in C to calculate simple interest for a set of values representing principal, no of years, and rate of interest.
- Get link
- X
- Other Apps
#include <stdio.h>
int main(){
float p, r;
int t;
printf("Enter the principal value: ");
scanf("%f", &p);
printf("\nEnter the rate of interest: ");
scanf("%f", &r);
printf("\nEnter the no of years: ");
scanf("%d", &t);
float si=(p*r*t)/100;
printf("\nThe simple interest is: %f", si);
printf("\nAmount have to be pay after %d years is: %f", t, p+si);
return 0;
}
- Get link
- X
- Other Apps
Comments
Post a Comment