C++ Online Compiler
Example: C++ program to find the power of any number by using pow() function
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// C++ program to find the power of any number by using pow() function #include <iostream> #include <cmath> // to import pow() function using namespace std; int main() { int b, e, r = 1; // b = base // e = exponent // r = result cout << "Enter the base & exponent values::\n"; cin >> b >> e; // finding power of base value by equiping exponent value r = pow(b, e); // Output cout << "\nResult:: " << b << "^" << e << " = " << r; return 0; }
5 7
Output
Clear
ADVERTISEMENTS