Create class Circle having variable radius and method area which finds the area
of a circle. Use default and parameterized constructor to initialize the values of
radius. Write a C++ program to calculate the area for three circles.
Answers
Answered by
1
import java.util.*;
public class Radius
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
float p,r;
System.out.println("Enter the perimeter");
p=in.nextFloat();
r=p*(7/22)*(1/2);
System.out.println("The radius is"+r);
}
}
Similar questions
Computer Science,
5 months ago
Social Sciences,
5 months ago
Math,
5 months ago
Biology,
11 months ago
Chemistry,
11 months ago
Chemistry,
1 year ago