C++ Program to raise any number x to a positive power n

#include<iostream.h>
#include<conio.h>
#include<math.h>                //for pow() function

void main()
{
clrscr();
int x,n,res;
cout<<“Enter value of x and n:”;
cin>>x>>n;

res=pow(x,n);
cout<<“nResult=”<<res;
getch();
}

One thought on “C++ Program to raise any number x to a positive power n

Leave a Reply

Your email address will not be published. Required fields are marked *