Pi is the most widely known mathematical constant that is commonly defined as the ratio of a circle’s circumference to its diameter approximately equal to 3.14159. It is also represented by the Greek letter “π”. Continue reading “Pi: Most widely known mathematical constant”
Because PI is a static property of Math, you always use it as Math.PI, rather than as a property of a Math object you created.
Output will be :
The Approximate value of PI is: 3.141592653589793
The following example is the simple implementation of the formula : A = PI * R* R, where R is the radius of the circle and A is the area of the circle.