ANSWER: Here I am giving you the code and output please like it or comment your doubt if you have any.
CODE:
import java.util.Scanner;
class Main
{
public static void printComputeArea(double radius){
double area = Math.PI * (radius * radius);
System.out.printf("The area of circle is:%.4f ", area);
}
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter the radius: ");
double radius = sc.nextDouble();
printComputeArea(radius);
}
}
OUTPUT:
Get Answers For Free
Most questions answered within 1 hours.