0

Java program for Area of a circle

Java area of a circle

12th Apr 2017, 2:18 AM
Oluwagbenga
5 Respuestas
+ 4
double area = Math.PI * radius * radius;
12th Apr 2017, 2:22 AM
Edward
+ 3
thats all you need... then do what you want with it. i.e. print it to the console
12th Apr 2017, 3:32 AM
Edward
+ 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); } }
12th Apr 2017, 4:13 AM
Babak
Babak - avatar
0
write the code for it please
12th Apr 2017, 2:37 AM
Oluwagbenga
0
Alright thank you very much
12th Apr 2017, 3:36 AM
Oluwagbenga