0
Java program for Area of a circle
Java area of a circle
5 Réponses
+ 4
double area = Math.PI * radius * radius;
+ 3
thats all you need... then do what you want with it. i.e. print it to the console
+ 3
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
float radius = 0.0f;
float area = 0.0f;
System.out.print("Enter circle radius: ");
radius = input.nextFloat();
area = 3.14159265f * radius * radius;
System.out.println("\nArea is: " + area);
}
}
0
write the code for it please
0
Alright thank you very much