Saturday, March 6, 2021

C program to calculate and print the simple interest.

 

1.     Write a C program to calculate and print the simple interest.

 

#include<stdio.h>

#include<conio.h>

int main()

{

float p, t, r, i;

printf("Enter principal: ");

scanf("%f", &p);

printf("Enter time: ");

scanf("%f", &t);

printf("Enter rate: ");

scanf("%f", &r);

i = (p*t*r)/100;

printf("Simple Interest = %.2f", i);

return 0;

}

No comments:

Post a Comment