Computer Science, asked by geetprjhasreet, 1 year ago

how to calculate area of circle in java program

Answers

Answered by jayanthsreejith
0
double r=Double.parseDouble(br.readLine()); (for obtaining the value of radius)
double area=3.14*r*r;
System.out.println("Area="+area);
Answered by devanujroy89
0

Answer:

import java.util.Scanner;

public class area

{

   public static void main(String []args)  

   {

    int r;

    double area;

    Scanner sc = new Scanner(System.in);

    System.out.println("Enter the radius of the circle");

    r = sc.nextInt();

    area = (Math.pow(r,2)*22)/7;

    System.out.println("The answer is ="+area);

     

     

   }            

}

Similar questions