Hello friends!!!!!

Basic power function in C++

C++

10/21/20241 min read

#include <iostream>

#include<cmath>

using namespace std;

int main() {

int r, a, b;

cout<<"Enter a value of base : "<<endl;

cin>> a ;

cout<<"Enter the value of power : "<<endl;

cin>> b;

r=pow(a , b);

cout<<"The value is "<<r<<endl;

return 0;

}

Output :

Enter a value of base :

23

Enter the value of power :

2

The value is 529

=== Code Execution Successful ===