In this easy coded program, you will learn how to calculate simple interest until the user says to continue by
taking input of principle amount, number of years, rate of interest and wish for continuation
from the user.
Try adding final calculated amount which will include the principle amount plus the calculated simple interest in this program for your self practice.
---------------------------------------------------------------------------
Output
Hope you found this 'C Program to Calculate Simple Interest Until User Says to Continue' easy, simple and helpful!
Try to solve more queries by yourself by referring more examples from BEGINC. Here you will get the most easiest code to each and every query. Keep practicing. More programs are coming.
Try adding final calculated amount which will include the principle amount plus the calculated simple interest in this program for your self practice.
---------------------------------------------------------------------------
Program to Calculate Simple Interest Until User Says to Continue
/*Simple Interest Until User says to Continue- do while loop*/
|
#include<stdio.h>
|
void main()
|
{
|
float
p, n, r, si;
|
char
opt;
|
do
|
{
|
printf("Enter Principle Amount, No. of Years, Rate of Interest=
");
|
scanf("%f %f %f",
&p,
&n,
&r);
|
si = (p*n*r)/100;
|
printf("\nSimple Interest= %f\n",
si);
|
printf("\nDo you want to
continue? Y/y OR N/n: ");
|
scanf("%s",
&opt);
|
}
while(opt=='Y'||opt=='y');
|
}
|
Output
Enter Principle Amount, No. of Years, Rate of Interest= 1000 10 10
Simple Interest= 1000.000000
Do you want to continue? Y/y OR N/n: y
Enter Principle Amount, No. of Years, Rate of Interest= 2000 12 11.3
Simple Interest= 2712.000000
Do you want to continue? Y/y OR N/n: n
---------------------------------------------------------------------------Hope you found this 'C Program to Calculate Simple Interest Until User Says to Continue' easy, simple and helpful!
Try to solve more queries by yourself by referring more examples from BEGINC. Here you will get the most easiest code to each and every query. Keep practicing. More programs are coming.
Comments
Post a Comment
Please do not comment any spam links in the comment box.