write a Java program to accept the radius of a circle. Print the circumference and area of a circle. ( cirum = 2πr, area = πr^2)
Answers
Answered by
1
Answer:
Explanation:
import java.util.*;
class circle
{
public static void main(String ar[])
{
Scanner sc=new Scanner(System.in);
double r,circum,area;
System.out.println("Enter the radius of circle: ");
r=sc.nextDouble();
circum = (2)*(22/7)*(r);
area = (22/7)*r*r;
System.out.println("Circumference is: "+ circum);
System.out.println("area is: "+ area);
}
}
Similar questions