As suggested in the video, i built a code to calculate power operations.
#include
using namespace std;
#include
int main(int argc, char** argv) {
int a,b;
double c;
cout <<“Insert the base and the exponent”;
cin >>a>>b;
c=pow(a,b);
cout << “the result is”<<c<<endl;
return 0;
}
besides the string elements of the code, is this the correct way or there is a more pratical/efficient way to write it in C++?