Arjit wants to create a wall bisecting a circular ground. Write a program which takes the area of the ground in sq. units as input and gives the length of the wall(diameter) as the output. Find the diameter of the circle for any given area till 4 decimal places. Sample Input: 50.23 Sample Output: 7.9992 Hint: To find square root use Math.sqrt() and 3.14 as value of Pi. For rounding it upto 4 decimal places make use of DecimalFormat class of java.text package. Sample double d=123.456546; DecimalFormat f=new DecimalFormat("##.####"); System.out.println(f.format(d));
|