Friday, 17 May 2013

JAVA if else Statement

class file_name{


        public static void main(String ar[]){


                     int i=45;


                     if( i > 0){
                              System.out.println("I Is Positive");
                     }else if( i < 0){
                              System.out.println("I Is Negative");
                     }else  if( i == 0){
                              System.out.println("I is Zero");
                     }  
        }


OutPut
---------------------
I Is Positive

No comments:

Post a Comment