Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

area of circle in java

import java.util.Scanner;
public class AreaOfCircle {
   public static void main(String args[]){
      int radius;
      double area;
      Scanner sc = new Scanner(System.in);
      System.out.println("Enter the radius of the circle ::");
      radius = sc.nextInt();
      area = (radius*radius)*Math.PI;
      System.out.println("Area of the circle is ::"+area);
   }
}
Comment

Area of a Circle in Java Programming

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        double R,A;
        Scanner sc = new Scanner(System.in);
        R = sc.nextDouble();
        A = 3.14159 * R * R;
        System.out.printf("A=%.4f
",  A);
   }
}
Comment

PREVIOUS NEXT
Code Example
Java :: swing getsource 
Java :: button onclick java 
Java :: Create class from string variable JAVA 
Java :: commenting in java 
Java :: spring log info 
Java :: enum values to string array 
Java :: static import java 
Java :: how to add textview to listview in android 
Java :: first line of java code 
Java :: java swing get frame size 
Java :: haxe interface 
Java :: convert calendar to date java 
Java :: java get class name of object 
Java :: spring 5 jdbctemplate query for a single value 
Java :: findone in spring boot 2.4.1 
Java :: how to make popupwindow background blur in android 
Java :: Compare integers java sort 
Java :: arraylist vs vector in java 
Java :: java sort method 
Java :: currency formatter java 
Java :: queue and stack reader 
Java :: check if duplicate element in java 
Java :: StackAsMyArrayList 
Java :: initializing list in java 
Java :: get max of array java 
Java :: sort list of list java 
Java :: linked list vs array list vs vector 
Java :: Exception in thread "main" java.lang.NoClassDefFoundError sdkmanager 
Java :: how to call a non static method 
Java :: How to initialize a 3d array in Java? 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =