power function in cmath code example
Example 1: exponents c++
pow(base, exponent); //must #include <cmath> to use pow()
example:
#include <iostream>
#include <cmath> //must include this library
int main ()
{
int y;
int x =10;
y = pow(x,2); // y = x^2
}
Example 2: pow in cpp header file
#include<cmath> //header file for pow fun
pow(a,b) // a^b