please see below code for if else now

				
					package practice;

public class IfElse {

	public static void main(String[] args) {
		  int x = 20;
		    int y = 18;
		    if (x >= y) {
		      System.out.println("x is greater than or equal to y");
		    } else {
		    	System.out.println("x is less than y");
		    }
		    
		    int z = 50 ; 
		    if ( z == 51) {
		    	System.out.println("z is equal to 50");
		    }else {
		    	System.out.println("z is not equal to 50");
		    }
		    

	}

}

				
			

Explaination

 Output – 

x is greater than or equal to y

z is not equal to 50

Scroll to Top