C

Friday, 18 August 2017

Program to Calculate Simple Interest and Compound Interest

#include<stdio.h>
#include<math.h>
int main()
{
float p,q,r,smpi,cmpi;
int  n;
clrscr();
printf("Enter the value of principle 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);
smpi=((p*r*n)/100);
printf("The Simple Interest is=%f \n",smpi);
q=1+(r/100);
cmpi=p*pow(q,n)-p;
printf("The Compound Interest is=%f \n",cmpi);
return 0;
getch();
}


OUTPUT:-


No comments:

Post a Comment

Write a program to draw a circle using mid-point circle drawing algorithm.

#include<iostream.h> #include<graphics.h> #include<conio.h> void drawcircle(int x0, int y0, int r) {         ...