I'm currently working on my homework assignment. I do not really need help on it because I understand it and i'm watching online tutorials to further enhance my knowledge. But I am still confused on the <cmath> and <math.h> headers.
Basically I have to raise a power. I'm using the volume formula V=pi*r^2*h. I already declared PI using #declare PI 3.141592. But I just learned I cannot simply do (radius)^2 in C++ rather there's a power function pow() I have to do (around those terms not done fully learning it yet).
My question is with what I am doing, what header do I use or does it matter? Also can someone show me a small example of how to successfully raise a power?
That looks correct, but note that you could also save yourself the trouble of having to use <cmath> by just doing squared = (radius/12.0)*(radius/12.0) or radius*radius/144.0