Given a radius of the circle, write a java program to calculate and display the area of the circle. (Take ∏=3.142)
Input : radius= 5 Output: Area of circle is : 78.55 Input : radius= 8 Output: Area of circle is : 201.08
As we know to calculate the area of a circle, the radius of the circle must be known, so if the radius of the circle is known, then the area of the circle can be calculated by using the formula:
Area = 3.142*(radius)*(radius)
Below is the Java Program to calculate the area of the circle:-
Area of circle is :78.55
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.