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 wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay