RAISE TO POWER C++ by zuhaibriaz

VIEWS: 9 PAGES: 1

More Info
									#include<iostream.h>
#include<stdlib.h>
double raise to power(double x;int pow);
main(){
       int x,i,o,result;
       cout<<"enter the number"<<'\t';
       cin>>x;
       cout<<"enter the pow of the number";
       cin>>i;
       o=raise to pow(x,i);
       cout<<"raise to"<<i<<"is"<<o<<'\n';
       system("PAUSE");
       }
       double raise to power(double x,int pow)
       {
               double=result;
               result=0;
               for(int i=1;i<=pow;i++)
               {
                       result*=x;
                       }
                       return(result);
                       }

								
To top