English, asked by sonup8598, 14 days ago

Write a java program find the area of circle

Answers

Answered by jayajaya3573926
1

Answer:

1. Static Method

class AreaOfCircle. {

{

Scanner s= new Scanner(System. in);

System. out. println("Enter the radius:"); double r= s. nextDouble();

double area=(22*r*r)/7 ; System. out. println("Area of Circle is: " + area);

} }

https://javatutoring.com › calculate-...

Answered by hridaybhatcar
0

Answer:

import java.util.Scanner;

class Circle

{

Scanner sc=new Scanner(System.in);

private int r;

public void check()

{

 System.out.print("Enter the radius in cms: ");

 r=sc.nextInt();

 

 System.out.println("The area of the circle is "+3.14*r*r+" cm");

}

 public static void main(String[]args)

 {

  Circle r=new Circle();

  r.check();

 }

}

Explanation: For making this program you need to know the formula of The area of a circle

Similar questions