Computer Science, asked by rajshatrunjay5532, 1 year ago

C language to find compound interest and simple interest

Answers

Answered by diya654321
0
simple interest program

input is

#include
#include
void main()
{
int si,p,r,t;
printf(“enter the value of principle, rate and time :- “);
scanf(“\n%d%d%d”,&p,&r,&t);
si=(p*r*t)/100;
printf(“simple interest is %d “,si);
getch();
}

output is

enter the value of principle, rate and time :-
10
10
10
simple interest is 10


compound interest program is


input is

#include
#include
void main()
{
float ci,p,r,t;
printf(“enter the value of principle, rate and time:- “);
scanf(“\n%f%f%f”,&p,&r,&t);
ci=p*pow((1+r),t);
printf(“compound interest is :- %f “,ci);
getch();
}

output is

enter the value of principle, rate and time:-
10
9
1
compound interest is :- 100


i hope
it’s help you
Answered by Anonymous
0

int main()

{

    float p,q,r,SI,CI;

    int n;

   printf("Enter the value of Principal p = ");

    scanf("%f",&p);

    printf("Enter the value of Rate r = ");

    scanf("%f",&r);

    printf("Enter the value of Period in year n = ");

    scanf("%d",&n);

   SI = ((p*r*n)/100);

printf("Simple Interest SI=%f \n",SI);

q = 1+(r/100);

CI=p*pow(q,n)-p;

   printf("Compound Interest CI=%f \n",CI);

return 0;    

}

Similar questions