Program to find the area of circle in java.

package vedvarshney ;

import java.util.*;

public class Area

{

     public static void main(String[] args) 

    {

     int r ;

    double area;

    Scanner sc = new Scanner(System.in);

    System.out.print("enter the radius of circle=");

     r =sc.nextInt();

     area=3.14*r*r;

     System.out.println("the area of circle is ="+area);

     }

}

■》 Output->

enter the radius of circle=10

the area of circle is = 314.0

Comments

Popular posts from this blog

Introduction of java Programming language.

Stack data structure.