write a program in Java to assign radius with a value find and print area of circle using the formula: area=πR^2.
Answers
Answered by
14
//circle
public class circle
{
int r;
double area;
public void area()
{
r=4;
area=pi*r*r;
System.out.println("Area of circle is"
+ area);
}//method closed
}//class closed
public class circle
{
int r;
double area;
public void area()
{
r=4;
area=pi*r*r;
System.out.println("Area of circle is"
+ area);
}//method closed
}//class closed
Similar questions
India Languages,
8 months ago
Science,
8 months ago
Math,
8 months ago
Math,
1 year ago
India Languages,
1 year ago