by Dinesh Thakur Category: Control Structures

In this example we use BufferedReader class for Reading text from a character-input stream. After Enter any 5 Number we check if number ==0 then is zero if number greater than 0 then it is positive other wise negative.

Here is the Java Example for Enter 10 Number and Print the Number of Positive, Negative and Zeros Number:


class PosNegZer
            public static void main(String args[] )
            throws IOException
                   BufferedReader PosNeg = new BufferedReader(new InputStreamReader(;
                        String m;
                        int n,Pos, Neg, Zer,i;
                        System.out.println("Enter any 5 Number ");
                        System.out.println("The Positive Numbers are : "+Pos);
                        System.out.println("The Negative Numbers are : "+Neg);
                        System.out.println("The Zero Values are : "+Zer);

Number of Positive, Negative and Zeros Number

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Related Articles