Basic and Advance C Question:
Download Questions PDF

The predefined constant M_PI seems to be missing from my machines copy of math.h.

Answer:

That constant (which is apparently supposed to be the value of pi, accurate to the machine's precision), is not standard; in fact a standard-conforming copy of should not #define a symbol M_PI. If you need pi, you'll have to define it yourself, or compute it with 4*atan(1.0) or acos(-1.0). (You could use a construction like
#ifndef M_PI
#define M_PI 3.1415926535897932385
#endif

to provide your own #definition only if some system header file has not.)

Download C Programming Interview Questions And Answers PDF

Previous QuestionNext Question
What is a good way to implement complex numbers in C?Why does not C have an exponentiation operator?