DEV Community

hema latha
hema latha

Posted on

if else program - basic demo 2

package day1;

public class ifdemo {
public static void main(String[] args) {

int n = 10;

if (n > 5) {
    System.out.println("The number is greater than 5.");
        } 
else {
    System.out.println("The number is 5 or less.");
}
Enter fullscreen mode Exit fullscreen mode

}
}

Top comments (0)

Retry later