krishanjava
Showing posts with label
find number is even/odd in single statement
.
Show all posts
Showing posts with label
find number is even/odd in single statement
.
Show all posts
Saturday, 17 March 2018
Find number is even/odd in single statement?
public class EvenOdd
{
// Find number is even/odd in single statement
public static void main(String [] args)
{
int num=12;
System.out.println((num%2==0)?"Even":"Odd");
}
}
Older Posts
Home
Subscribe to:
Posts (Atom)