I am working on a homework assignment and I have to use Pi as part of a formula. Is there something built in to stdio for Pi or should I just make a float variable out to 4 or 5 decimals and call it a night?
I am working on a homework assignment and I have to use Pi as part of a formula. Is there something built in to stdio for Pi or should I just make a float variable out to 4 or 5 decimals and call it a night?
Just define a constant... #define pi = 3.1415 ... to whatever depth you need.
Include the "math.h" header file and use the symbol M_PI.
I used this... good?
Code:const float PI=3.141593
I realized the typo as soon as I posted it, and edited... I also used the semicolon at the end, but thanks!
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}