even or odd in java
Java
import java.util.Scanner;
public class evenOrOdd{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.println("Please enter a non-negative number: ");
int x = in.nextInt();
if (x % 2 == 0)
{
System.out.println("The number is even");
}
else {
System.out.println("The number is odd");
}
}
}
Also in Java:
- Title
- comparable on a generic class java
- Category
- Java
- Title
- if and in java
- Category
- Java
- Title
- length of string java
- Category
- Java
- Title
- java string to double
- Category
- Java
- Title
- find first non repeating character in a string
- Category
- Java
- Title
- how to check internet is working or not in java
- Category
- Java
- Title
- java check if directory exists
- Category
- Java
- Title
- write an infinite loop java
- Category
- Java
- Title
- continue in java
- Category
- Java
- Title
- java string split underscore
- Category
- Java
- Title
- how to convert char to uppercase java
- Category
- Java
- Title
- how to create a 2d arraylist java
- Category
- Java
- Title
- Manifest merger failed androidx
- Category
- Java
- Title
- cosinus-1 java
- Category
- Java
- Title
- how get started with LWJGL 3
- Category
- Java
- Title
- How to chage font progrmatically
- Category
- Java
- Title
- how to print in java
- Category
- Java
- Title
- count the number of words in a string java
- Category
- Java
- Title
- LocalRegistry java rebind() java8
- Category
- Java
- Title
- reentrantreadwritelock java
- Category
- Java
- Title
- java create map
- Category
- Java
- Title
- alfred workflow
- Category
- Java
- Title
- download spring
- Category
- Java
- Title
- swapping of two numbers in java
- Category
- Java
- Title
- convert array of int to arraylist java
- Category
- Java
- Title
- how to get the screen dimensions in java
- Category
- Java
- Title
- java hashmap get value
- Category
- Java
- Title
- reading in lines from a file java
- Category
- Java
- Title
- enum in java
- Category
- Java
- Title
- jtable fill panel
- Category
- Java
- Title
- java observable
- Category
- Java
- Title
- expression régulière seulement un espace java
- Category
- Java
- Title
- java 8 findany on null list
- Category
- Java
- Title
- sort array java
- Category
- Java
- Title
- integer max value java
- Category
- Java
- Title
- java list to set
- Category
- Java
- Title
- java round double to 2 decimal places
- Category
- Java
- Title
- how to find powers in java
- Category
- Java
- Title
- inheritance setter and getter in java
- Category
- Java
- Title
- java 8 loop in map
- Category
- Java
- Title
- Java for loop
- Category
- Java
- Title
- setting up javafx in eclipse
- Category
- Java
- Title
- StringBuilder java pop back
- Category
- Java
- Title
- java replace all xml decoding
- Category
- Java
- Title
- méthode retourne nom classe java
- Category
- Java
- Title
- processing audio android
- Category
- Java
- Title
- java map foreach
- Category
- Java
- Title
- java identifiers
- Category
- Java
- Title
- generate all prime number less than n java (fastest method)
- Category
- Java
- Title
- java add a list to a list
- Category
- Java
- Title
- how to count number of words in a string
- Category
- Java
- Title
- hide elements android
- Category
- Java
- Title
- java execute jar from main
- Category
- Java
- Title
- java get current milliseconds
- Category
- Java
- Title
- run spring boot application command line
- Category
- Java
- Title
- java stack methods
- Category
- Java
- Title
- how to minimize jframe in java
- Category
- Java
- Title
- java main method
- Category
- Java
- Title
- a recursive function that calculates the greatest common divisor from user's input in java
- Category
- Java
- Title
- java function for power
- Category
- Java
- Title
- formartted string java
- Category
- Java
- Title
- how to use lambda in java
- Category
- Java
- Title
- how to send http post create request using curl command
- Category
- Java
- Title
- java convert char to int
- Category
- Java
- Title
- null pointer exception java
- Category
- Java
- Title
- how to extract data from delimited text file in java
- Category
- Java
- Title
- java 8 add whole array to jsonarray
- Category
- Java
- Title
- how to create array of linkedlist in java
- Category
- Java
- Title
- connect 2 package in android
- Category
- Java
- Title
- get number of items in arraylist java
- Category
- Java
- Title
- java 8 function supplier consumer
- Category
- Java
- Title
- init cap java
- Category
- Java
- Title
- how to skip a line in java
- Category
- Java
- Title
- select photo from camera android
- Category
- Java
- Title
- android how to switch between activities
- Category
- Java
- Title
- how to change the color of a menubar in java
- Category
- Java
- Title
- arrays.fill java
- Category
- Java
- Title
- how to instanciate map.entry java
- Category
- Java
- Title
- java create clas
- Category
- Java
- Title
- method resolve file in java
- Category
- Java
- Title
- editer un label java
- Category
- Java
- Title
- check if map contains key java
- Category
- Java
- Title
- android dismiss keyboard
- Category
- Java
- Title
- java get input
- Category
- Java
- Title
- instantiate optinal java 8
- Category
- Java
- Title
- google translate
- Category
- Java
- Title
- java import text file into arraylist
- Category
- Java
- Title
- android java how to stop users fromgoing back too much
- Category
- Java
- Title
- get file path java
- Category
- Java
- Title
- binary string to int java
- Category
- Java
- Title
- java console text color
- Category
- Java
- Title
- java mouseevent
- Category
- Java
- Title
- index of an array procesing
- Category
- Java
- Title
- java check if element exists in array
- Category
- Java
- Title
- creating array java
- Category
- Java
- Title
- working with buttons in applet java
- Category
- Java
- Title
- como detener un void java
- Category
- Java
- Title
- exception handling and reprompting
- Category
- Java
- Title
- javafx action event enter key
- Category
- Java
- Title
- java read file bufferedreader
- Category
- Java