My Blog
—
by
public class EvenOdd { public static void main(String[] args) { int num = 5; if(num % 2 == 0) System.out.println(num + ” is even.”); else System.out.println(num + ” is odd.”); }
Output:
5 is odd.
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Leave a Reply