import java.io.*;
class simple_area_circle
{
public static void main(String args[])
{
try
{
int r;
float pie=3.14f,a;
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter a radius to calculate area of circle");
r=Integer.parseInt(cin.readLine());
a=r*r*pie;
System.out.println("area of circle with radius "+r+" is = "+a);
}
catch(Exception e)
{
System.out.println("Wrong data");
}
}
}
No comments:
Post a Comment