Area of a Circle in JAVA programming


package SolveProblem;

import java.util.Scanner;

public class AreaOfACircle {

    public static void main(String[] args) {
        Scanner myScanner=new Scanner(System.in);
        double Area,radius;
        System.out.println("Enter the radius of the Circle : ");
        radius=myScanner.nextDouble();
       
        Area=Math.PI*radius*radius;
       
        System.out.println("Area of the Circle is : "+Area);
    }

}
//--------------------------Input & Output-----------------

//Enter the radius of the Circle :
//34
//Area of the Circle is : 3631.6811075498013

No comments:

Post a Comment