Monday, 12 August 2013

W.A.P to Find ODD or EVEN in Java

import java.util.Scanner;
class oddeven
{
    public static void main(String []args)
    {
        int x;
        System.out.println("Enter the Number");
        Scanner obj=new Scanner(System.in);
        x=obj.nextInt();
       
        if(x%2==0)
        {   
            System.out.println("Even Number");
        }
        else
        {
            System.out.println("Odd Number");
        }
    }
}



0 comments:

Post a Comment

Followers