Java Blog

 
 
 
 public class JAVA_023
 {

    public static void main(String[] args)
    {
       int number=(int)(Math.random( )*100);

       System.out.println(\"Random Generated Number ( \" + number + \" ) is : \"
                                             + ((number%2)==0?\"Even\":\"Odd\"));
    }
 }

 
 
Didn't find what you were looking for? Find more on Program to show the use of Conditional (Ternary) Operator