Java Odd or Even
Code Example to determine if a number entered is odd or even
import java.util.Scanner;
class OddOrEven {
public static void main(String args[]) {
public static void main(String args[]) {
int num;
System.out.println("Enter an Integer number:");
Scanner input = new Scanner(System.in);
num = input.nextInt();
if ( num % 2 == 0 )
System.out.println("The number is even");
else
else
System.out.println("The number is odd"); } }
Java was called Oak at the beginning
The original name for Java was Oak. Java legend has it that a big oak tree that grew outside the developer James Gosling’s window.
Click here to see this code run
Java Fun Fact
Java was called Oak at the beginning
The original name for Java was Oak. Java legend has it that a big oak tree that grew outside the developer James Gosling’s window.
Comments
Post a Comment