Write a program to calculate simple interest.

#include <stdio.h>

int main(void)
{
/* Variable declaration statements */
int years;
float principle, rate, simple_int;

/* Ask the user to enter values for the variables */
printf("\nPrinciple, Number of years and Rate of interest : ");
scanf("%f%d%f", &principle, &years, &rate );

/* Calculate the simple interest */
simple_int = principle * years * rate / 100;

/* Display variable values */
printf( "\nSimple Interest = %f", simple_int);

return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin