upsidedown

oops_tut

Feb 12th, 2012
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<math.h>
  3. double power(double m,int n=2);
  4. double power(int m,int n=2);
  5.  
  6. double power(double m,int n)
  7. {
  8.     return pow(m,n);
  9. }
  10.  
  11. double power(int m,int n)
  12. {
  13.     return pow(m,n);
  14. }
  15.  
  16. int main()
  17. {
  18.     int n,j;
  19.     double m;
  20.     cout<<"enter the value of the indice and the (double)base and (integer)base number\n n=";
  21.     cin>>n;
  22.     cout<<"\n m=";
  23.     cin>>m;
  24.     cout<<"\n j=";
  25.     cin>>j;
  26.     cout<<"the square of "<<m<<" is : "<<power(m)<<endl;
  27.     cout<<"the value of "<<m<<"^"<<n<<" is : "<<power(m,n)<<endl;
  28.     cout<<"the sqyare of "<<j<<" is : "<<power(j)<<endl;
  29.     cout<<"the value of "<<j<<"^"<<n<<" is : "<<power(j,n)<<endl;
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment