0 votes
by (420 points)
How do you raise to a power in C++?

1 Answer

0 votes
by (1.7k points)
Standard C++ doesn't have a constant for PI. Many C++ compilers define M_PI in cmath (or in math. h for C) as a non-standard extension. You may have to #define _USE_MATH_DEFINES before you can see it.Nov 13, 2009');})();(function(){window.jsl.dh('_LomNYKTJFuu70PEPrMel8A046','
');})();(function(){window.jsl.dh('12','
#define PI 3.14

Here, #define is a pre-processor directive. It is used to define something, like here we have defined that PI is 3.14. So, before going to the compiler, if 'PI' comes anywhere in the program, it will be replaced by 3.14.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked May 21, 2021 by program (420 points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Aug 4, 2021 by freesoftware (120 points)
0 votes
1 answer
asked Jul 9, 2021 by usearduino (180 points)
...