#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
    
int base,expo;
long result=1;
cout<<"enter base:";
cin>>base;
cout<<"enter exponent:";
cin >>expo;
    if (expo>=0)
    {
    for(int i=0;i<expo;i++){
        result *=base;
    }}
else {
    for(int i=0;i>expo;i--)
        {
            result/=base;
        }
}
cout<<base<<"^"<<expo<<"="<<result<<endl;
system("pause");
return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: