Question From :
Fathima Neethu
Malappuram
fathimaneethu88@gmail.com
Answer:
import java.io.*;
import java.lang.*;
import java.io.DataInputStream;
class Area
{
int r;
void calculate()
{
try
{
DataInputStream in=new DataInputStream(System.in);
r=Integer.parseInt(in.readLine());
}
catch(Exception e)
{
}
System.out.println("Area of the circle = " + 3.14*r*r);
System.out.println("Circumference of the circle = " + 2*3.14*r);
}
}
class AreaDemo
{
public static void main(String args[])
{
Area area=new Area();
area.calculate();
}
}
O/P
0 comments:
Post a Comment