Computer Science, asked by rubyt859, 1 month ago

WAP in java to find whether the user given number is even or odd.​

Answers

Answered by ANTMAN22
1

import java.util.*;

public class Evenorodd

{

   public static void main()

   {

       Scanner in=new Scanner (System.in);

       int n;    

       System.out.println("Enter the number");

       n=in.nextInt();     //Taking the number input from the user

       if(n%2==0)      

       System.out.println("Even number");

       else

       System.out.println("Negative number");

   }

}

Attachments:
Similar questions