Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

even and odd java &

import java.util.Scanner;

class CheckEvenOdd
{
  public static void main(String args[])
  {
    int num;
    System.out.println("Enter an Integer number:");

   
    Scanner in = new Scanner(System.in);
    num = in.nextInt();

   
    if ( (num & 1)= 1 )
        System.out.println("Entered number is odd");
     else
        System.out.println("Entered number is even");
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: Java Regex : 4 Letters followed by 2 Integers 
Java :: vscode code formatter cannot format 
Java :: Divide two integers without using multiplication, division and mod operator 
Java :: actuator spring boot 
Java :: smart ways to print a matrix in java 
Java :: how to create a function in java 
Java :: Loop in singly linked list 
Java :: adjust font scale in android studio 
Java :: read qr code from image java 
Java :: tableau deux dimensions java 
Java :: java pointer 
Java :: switch statement java 
Java :: Java Access ArrayList Elements 
Java :: unchecked exception in java 
Java :: android java how to blur an image 
Java :: java spring username encode and decode 
Java :: queue.isempty java 
Java :: java get substring 
Java :: check if char is letter or digit 
Java :: method parameters in java 
Java :: change text size java 
Java :: Java FileOutputStream to write data to a File 
Java :: how to call super onbackpressed in fragment 
Java :: no of words in a string in java 
Java :: setimageuri crash 
Java :: int[] java 
Java :: calling java static method in kotlin 
Java :: hwo to create a list of 1 to n nums in java list 
Java :: maximum number from random number in java 
Java :: android list tostring 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =