Computer Science, asked by mahijaiswal123, 1 year ago

write a program that compute the area and circumference of a circle or radius 3.0 using 3.4 is the value for complete in Java program​

Answers

Answered by guruu99
0

Answer:

Here's a Java program that calculates the area and circumference of a circle with a radius of 3.0, using 3.14 as the value of pi.

Explanation:

Here's a Java program that calculates the area and circumference of a circle with a radius of 3.0, using 3.14 as the value of pi:

public class Circle {

   public static void main(String[] args) {

       double radius = 3.0;

       double pi = 3.14;

       double area = pi * radius * radius;

       double circumference = 2 * pi * radius;

       

       System.out.println("The area of the circle is: " + area);

       System.out.println("The circumference of the circle is: " + circumference);

   }

}

In this program, we declare two double variables to hold the values of the radius and pi, and then calculate the area and circumference using the formulas for these values. Finally, we print out the results using System.out.println().

To know more about java: https://brainly.in/question/19161562

To know more about double: https://brainly.in/question/8426060

#SPJ3

Similar questions