Raptor
0
Q:

exponents c++

#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
  double base, exponent, result;		
  base = 3.4;	
  exponent = 4.4;	
  result = pow(base, exponent);		
  cout << base << "^" << exponent << " = " << result;		
  return 0;
}
10
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
}
0

New to Communities?

Join the community