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)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay