Answers for "pow in c++"

C++
20

pow 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;
}
Posted by: Guest on January-10-2020
3

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
}
Posted by: Guest on October-19-2020
1

pow in cpp header file

#include<cmath> //header file for pow fun


   pow(a,b)    // a^b
Posted by: Guest on July-12-2020
1

pow in c++

#include <cmath>
pow(base, exponent);
Posted by: Guest on June-05-2021
2

pow() c

int base = 3;
int power = 5;
pow(double(base), double(power));
Posted by: Guest on December-05-2020
1

c++ power

/* pow example */
#include <stdio.h>      /* printf */
#include <math.h>       /* pow */

int main ()
{
  printf ("7 ^ 3 = %f\n", pow (7.0, 3.0) );
  printf ("4.73 ^ 12 = %f\n", pow (4.73, 12.0) );
  printf ("32.01 ^ 1.54 = %f\n", pow (32.01, 1.54) );
  return 0;
}
Posted by: Guest on November-18-2020

Browse Popular Code Answers by Language