0 votes
by (420 points)
How do you write Square in C++?

1 Answer

0 votes
by (1.3k 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('_ZqCLYIOrB5LEsAXv6r0o43','
');})();(function(){window.jsl.dh('11','
#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 23, 2021 by program (420 points)
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)
0 votes
1 answer
asked Jun 15, 2021 by usearduino (180 points)
0 votes
1 answer
asked May 14, 2021 by cides (140 points)
0 votes
0 answers
asked May 9, 2021 by cides (140 points)
...