Decode School

Decode School - The School for Problem Solvers
Need Assignment / Project Guidance (or) Training in Python?

Java Program to find area of Circle (Use Constant)

Get radius of circle and find area of circle.

Sample Input 1:


Sample Output 1:


Program or Solution

import java.util.*;
class Circle
    public static void main(String args[])
        double radius;
        double area;
        Scanner sc=new Scanner(;
        System.out.println("Get the radius of Circle and find area of Circle");
        System.out.println("Enter The Input 1:");
        System.out.println("The Output 1 Is:\n"+area);



Program Explanation

Get radius of a circle (using scanner class) Calculate area by multiplying pi and radius and radius (area =pi*radius*radius) (pi is 3.14 , global constant) Print area (using system.out.println)