Wednesday, 11 February 2015

u2p3

Write a program to evaluate the following investment equation V = P(1+r)n.


 #include<iostream.h>  
 #include<conio.h>  
 #include<math.h>  
 void main()  
 {  
      clrscr();  
      unsigned long int v;  
      int p,a=0;  
      float r,n;  
       cout<<"This program evaluates investment equation V = P(1+r)n";  
       cout<<"\n\nEnter value of P : ";  
       cin>>p;  
       cout<<"\nEnter value of r : ";  
       cin>>r;  
       cout<<"\nEnter value of n(months) : ";  
       cin>>n;  
       a = p*(1+r);  
       v = a*(n/12);  
       cout<<"\n\nValue of V is "<<v;  
       getch();  
 }  

OUTPUT

No comments:

Post a Comment