#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int i,v,p,n,a;
float r;
char ch;
clrscr();
while(ch != 'n')
{
printf("\nEnter the value of p :: ");
scanf("%d",&p);
printf("Enter the value of r :: ");
scanf("%f",&r);
printf("Enter the value of n :: ");
scanf("%d",&n);
a = p * (1 + r);
v = pow(a,n);
printf("Value of v is :: %d",v);
printf("\nDo you want to continue ? ");
flushall();
ch = getchar();
}
getch();
}
/*
**********
OUTPUT
**********
Enter the value of p :: 1000
Enter the value of r :: 0.10
Enter the value of n :: 1
Value of v is :: 1100
Do you want to continue ? y
Enter the value of p :: 2000
Enter the value of r :: 0.11
Enter the value of n :: 2
Value of v is :: 8761
Do you want to continue ? n
*/