1: #include<stdio.h>
2: #include<conio.h>
3: #include<math.h>
4: void main()
5: {
6: int p,n=1;
7: float a,i,power;
8: printf("\nEnter the principal: ");
9: scanf("%d",&p);
10: printf("\nEnter the interest: ");
11: scanf("%f",&i);
12: do
13: {
14: a=p*pow(1+i,n);
15: printf("\nAmount For %d year= %.3f\n",n,a);
16: n++;
17: }while(n<=5);
18: getch();
19: }
No comments:
Post a Comment