How do I use power in C++?

Asked

Viewed 5,276 times

0

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

I’ve tried to Pow() and did not give, need to add some class?

1 answer

7


Is not Pow, is pow.

Upper and lower case 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 on IDEONE.

  • Vlw is that I am beginner. Gave straight.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.