Ferix

RSOJava#6

Nov 25th, 2020
482
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. import java.lang.Math;
  3.  
  4. public class MyClass {
  5.     public static void main(String args[]) {
  6.        
  7.         Scanner input = new Scanner(System.in);
  8.        
  9.         double area = input.nextDouble();
  10.        
  11.         if(area<=0){
  12.             System.out.println("Area cannot be 0 or lower than 0...");
  13.         } else{
  14.             double radius = Math.sqrt(area/Math.PI);
  15.             System.out.println("Circle radius is "+ radius);
  16.         }
  17.     }
  18. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×