fork download
  1. // Julie Anne H. Generaole
  2. import java.util.Scanner;
  3.  
  4. class CircleAreaIO
  5. {
  6. public static void main (String[] args)
  7. {
  8. Scanner scan = new Scanner (System.in);
  9.  
  10. int radius=35;
  11. double areaCircle;
  12.  
  13. if ( radius < 0)
  14.  
  15. System.out.println("Enter radius:35");
  16. else
  17. System.out.println("radius is not negative:");
  18. areaCircle= Math.PI*Math.pow (radius,2);//calculates the area of a Circle
  19. System.out.println("Area of the Circle:" +areaCircle);
  20. }
  21. }
Success #stdin #stdout 0.15s 53580KB
stdin
Standard input is empty
stdout
radius is not negative:
Area of the Circle:3848.4510006474966