# Field Manual for Hackers

## Write a program to find area of circle in Java. Note: Take input from user at run time.

1. import java.util.Scanner;

class Test{

public static void main(String ar[])
{

float a,area;
Scanner sc=new Scanner(System.in);
System.out.println("Enter Radius to find Area of the Circle");
a=sc.nextFloat();
area=22*a*a/7;
System.out.println("Area is "+area);

}
}

2. //program to find area of circle
import java.util.Scanner;
class Area
{
public static void main(String Args[])
{ double r;
double ar;
Scanner scan=new Scanner(System.in);
r=scan.nextDouble();

ar=3.14*r*r;
System.out.println("area of circle is"+ar);
}}

3. import java.util.Scanner;

class areaCircle
{
public static void main(String ar[])
{ double r;
double Total;
Scanner sc=new Scanner(System.in);
r=sc.nextDouble();
Total=3.14*r*r;
System.out.println("area of circle="+Total);
}
}

4. import java.util.Scanner;

class Test
{

public static void main(String ar[])
{
Scanner o= new Scanner(System.in);
System.out.println("Area is: "+area);
}

}

5. This comment has been removed by the author.

6. import java.util.Scanner;

class area

{
public static void main(String ar[])
{
Scanner objscan = new Scanner(System.in);
System.out.println("Enter the radius of the circle");
System.out.print("the area of the circle is : " );
System.out.println(area);

}

}

7. import java.util.Scanner;
public class Circle
{
public static void main(String args[])
{
float c,r,pi=3.14f;
System.out.println("enter number");
Scanner sc=new Scanner(System.in);
r=sc.nextFloat();
c=r*r*pi;
System.out.println(c);
}
}

8. import java.util.Scanner;
class A{
public static void main(String ar[]){
Scanner obj=new Scanner(System.in);
double area;
System.out.println("area of the circle is"+area);
}
}

9. class Circle{
public static void main(String ar[]){
Double a;
Double r=Double.parseDouble(ar[0]);
a=3.14*r*r;
System.out.printf("area="+a);
}
}

10. import java.util.Scanner;

class Circle{

public static void main(String ar[]){

double r,area=0;

Scanner scan=new Scanner(System.in);

System.out.println("Enter value of r");
r=scan.nextInt();

area=3.14*r*r;
System.out.println("Area="+area);

}

}