In C, the value of the mathematical constant PI is not predefined as a keyword or constant in the standard library. However, you can access an accurate value of PI by including the
#include
#include
int main() {
printf(“The value of PI is: %f\n”, M_PI);
return 0;
}
If M_PI is unavailable in your compiler, you can define it manually like this:
#define PI 3.141592653589793
This ensures consistent PI usage across your program.