area of circle
previous NextExample
import java.util.Scanner;
class Area
{
public static void main(String[] args) {
int radius;
float area;
Scanner sc = new Scanner(System.in);
System.out.println("Enter radius of the circle");
radius = sc.nextInt();
area = (float)(3.14 * radius * radius);
System.out.println("Area of the circle: "+area);
}
}
Output :
Enter radius of the circle
5
Area of the circle: 78.5