C
c_beginner
yes, this is my how work question. Since I am lack in getting
an assistance with my lab work I put this in this advance group.
Sorry for the trouble I am making.
Write a program to calculate the simple interest.
#include<stdio.h>
int intrest(int rate,float amount);
int main(void)
{
int intrest_rate, /* the percentage intrest*/
return_year ; /* year of returing the amt*/
float money, /* amount which has been browed*/
intrest_amt, /* intrest to be paid */
si; /* calcuation of simple intrest*/
printf("input the intrest,amount,return year\n");
scanf("%d%f%d",&intrest_rate,&money,&return_year);
if((return_year < 1) && (return_year > 50))
printf("enter the year again.The year should not be greater than 50");
intrest_rate = intrest(intrest_rate,money);
if(intrest_rate)
si = money * intrest_amt * return_year;
printf("The simple intrest is %f\n",si);
}
int intrest(int rate,float amount)
{
int temp;
if((rate < 0) || (rate > 100))
{
printf("the intrest rate is either too high or low\n");
exit(1);
}
return temp = ((amount * rate) / 100);
}
an assistance with my lab work I put this in this advance group.
Sorry for the trouble I am making.
Write a program to calculate the simple interest.
#include<stdio.h>
int intrest(int rate,float amount);
int main(void)
{
int intrest_rate, /* the percentage intrest*/
return_year ; /* year of returing the amt*/
float money, /* amount which has been browed*/
intrest_amt, /* intrest to be paid */
si; /* calcuation of simple intrest*/
printf("input the intrest,amount,return year\n");
scanf("%d%f%d",&intrest_rate,&money,&return_year);
if((return_year < 1) && (return_year > 50))
printf("enter the year again.The year should not be greater than 50");
intrest_rate = intrest(intrest_rate,money);
if(intrest_rate)
si = money * intrest_amt * return_year;
printf("The simple intrest is %f\n",si);
}
int intrest(int rate,float amount)
{
int temp;
if((rate < 0) || (rate > 100))
{
printf("the intrest rate is either too high or low\n");
exit(1);
}
return temp = ((amount * rate) / 100);
}