Im trying to show pi. I know how to set precision and all that, but I cant seem to get it! I did this:
1 2
#define _USE_MATH_DEFINES
#include <cmath>
Isnt this what I supposed to do? I think there's something to do with M_PI, but I type that in and its still underlined in red in my compiler. What mistake am I making?
EDIT: DO I have to type in all the digits of pi and then define it? just wondering
Line 9 uses the fact that the angle whose tangent equals 1, is PI/4 radians or 45 degrees. So calculate it once at the start of the program and from then on use the stored value.