Code:
import java.util.Scanner;
class Circle
{
static Scanner sc=new Scanner(System.in);
public static void main(String args[])
{
System.out.print("\n\nEnter the Radius: ");
double radius=sc.nextDouble();
double area=Math.PI*(radius*radius);
System.out.print("\nThe area of the circle is:" + area);
double circumference=Math.PI*2*radius;
System.out.print("\nThe Circumference of the circle is:" + circumference +"\n\n");
}
}
No comments:
Post a Comment