Computer Science, asked by baidehiedas24, 4 days ago

in small basic write a program that inputs the radius of a circle and displays its area and circumference with proper messages.
note: for the value of PI, use Math.PI()​

Answers

Answered by samarthkrv
0

Answer:

import java.lang.*;

import java.util.*;

class HelloWorld {

   public static void main(String[] args) {

       Scanner sc = new Scanner(System.in);

       System.out.print("Enter radius:");

       double rad = sc.nextDouble();

       double area = Math.PI*rad*rad;

       double cir = 2*Math.PI*rad;

       System.out.println("Area of the circle is " + area + " and the circumfrence of the circle is " + cir);

   }

}

Explanation:

Similar questions