How do I use power in C ++? [closed]

0

I'm making a simple calculator, and wanted to add power.

I've tried Pow() and did not, do you need to add some class?

    
asked by anonymous 11.03.2018 / 22:47

1 answer

7

It is not Pow , it is pow .

Case-sensitive make a difference in C ++

And the library is math :

#include <math.h>

int main ()
{
  printf ("5 ^ 3 = %f\n", pow(5.0, 3.0));
  return 0;
}

See working at IDEONE .

    
11.03.2018 / 22:53