Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<math.h>
- double power(double m,int n=2);
- double power(int m,int n=2);
- double power(double m,int n)
- {
- return pow(m,n);
- }
- double power(int m,int n)
- {
- return pow(m,n);
- }
- int main()
- {
- int n,j;
- double m;
- cout<<"enter the value of the indice and the (double)base and (integer)base number\n n=";
- cin>>n;
- cout<<"\n m=";
- cin>>m;
- cout<<"\n j=";
- cin>>j;
- cout<<"the square of "<<m<<" is : "<<power(m)<<endl;
- cout<<"the value of "<<m<<"^"<<n<<" is : "<<power(m,n)<<endl;
- cout<<"the sqyare of "<<j<<" is : "<<power(j)<<endl;
- cout<<"the value of "<<j<<"^"<<n<<" is : "<<power(j,n)<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment