cpp power of number code example
Example 1: how to write something in power of a number in c++
#include <iostream>
#include <cmath>
using namespace std;
int main(){
cout<<pow(10,2);
return 0;
}
Example 2: 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
}