Program to display message whether the given number is positive, negative or zero.

class hello
{    public static void main(String[] edc)throws IOException
BufferedReader obj=new BufferedReader(new InputStreamReader(;
int n;
String num;
System.out.println("Enter a number::");
num= obj.readLine();
if(n==0) System.out.println("Number is zero.");
else if(n>0) System.out.println("Number is positive.");
else if(n<0) System.out.println("Number is negative.");


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s