4) write a program that inputsradius of a circle and finds itsperimeter.
Answers
Answered by
1
Answer:
import java.util.Scanner;
public class AreaAndCircumferenceOfCircle.
{
public static void main(String args[])
{
double circumference, area;
int radius;
//object of the Scanner class.
Answered by
1
import java.util.Scanner;
public class calculate
{ double radius= sc. nextDouble(); double circumference=2*Math.PI radius; double area= Math. Pl*radius*radius;
public static void main(String[] args)
{
Scanner sc= new Scanner (System.in);
System.out.println("Enter the radius of the circle: ");
System.out.println("The circle with radius"+radius+" has an area of: "+area);
System.out.println("The circle with radius"+radius+" has a circumference of: "+circumference);
}
}
Similar questions