Write a program in Java io input the radius of a circie. Calculate and print its area
and ciroumfcrence along with the proper messages.
Area = pie square 2
Circumference - 2r pie
Where: r-radius of the circle
pie= constant whose value is = 22/7
Answers
Answered by
2
Answer:
import java.util.Scanner;
class calArea
{
public static void main (String args [])
{
Scanner sc = new Scanner (System.in);
System.out.println("Enter radius of circle.")
double r =sc.nextDouble();
double a = math.pi * math.pow(r, 2);
double c = 2*math.pi*r;
System.out.println("Area of circle is "+a);
System.out.println("Circumference of circle is "+c);
}
}
Similar questions