Rotate your phone or change to desktop for better experience

Rotate your phone or change to desktop for better experience

Pgm 3 || Program to find the area and circumference of the circle by accepting the radius from the user.

 import java.util.*;

public class Pgm3

{

public static void main(String[] args)

{

double radius, area, circumference;

Scanner in1 = new Scanner(System.in);

System.out.println("Enter Radius of Circle:");

radius = in1.nextDouble();

// Calculate area and circumference of circle

area = 3.142 * radius * radius;

circumference = 2 * Math.PI * radius;


System.out.println("Area of Circle : " + area);

System.out.println("Circumference of Circle : " + circumference);

}

}

Post a Comment

0 Comments