Welcome to Westonci.ca, where curiosity meets expertise. Ask any question and receive fast, accurate answers from our knowledgeable community. Join our Q&A platform to get precise answers from experts in diverse fields and enhance your understanding. Get quick and reliable solutions to your questions from a community of experienced experts on our platform.
Sagot :
Answer:
* Program to find diameter, circumference and area of circle.
*/
import java.util.Scanner;
public class Circle {
public static void main(String[] args) {
// Declare constant for PI
final double PI = 3.141592653;
Scanner in = new Scanner(System.in);
/* Input radius of circle from user. */
System.out.println("Please enter radius of the circle : ");
int r = in.nextInt();
/* Calculate diameter, circumference and area. */
int d = 2 * r;
double circumference = 2 * PI * r;
double area = PI * r * r;
/* Print diameter, circumference and area of circle. */
System.out.println("Diameter of circle is : " + d);
System.out.println("Circumference of circle is : " + circumference);
System.out.println("Area of circle is : " + area);
}
}
Thanks for stopping by. We are committed to providing the best answers for all your questions. See you again soon. Thank you for your visit. We're dedicated to helping you find the information you need, whenever you need it. Westonci.ca is here to provide the answers you seek. Return often for more expert solutions.