Hi,
import java.io.*;
import java.net.*;
class Client
{
public static void main(String ar[])throws Exception
{
Socket s=new Socket(InetAddress.getLocalHost(),10000);
System.out.println("enter the radius of the circle ");
DataInputStream dis=new DataInputStream(System.in);
int n=Integer.parseInt(dis.readLine());
PrintStream ps=new PrintStream(s.getOutputStream());
ps.println(n);
DataInputStream dis1=new DataInputStream(s.getInputStream());
System.out.println("area of the circle from server:"+dis1.readLine());
}
}
import java.io.*;
import java.net.*;
class Server
{
public static void main(String ar[])throws Exception
{
ServerSocket ss=new ServerSocket(10000);
Socket s=ss.accept();
DataInputStream dis=new DataInputStream(s.getInputStream());
int n=Integer.parseInt(dis.readLine());
PrintStream ps=new PrintStream(s.getOutputStream());
ps.println(3.14*n*n);
}
}