In reference to your module #2,Create a simple program that will print ODD or EVEN when you enter a number.
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
System.out.print("Enter number: ");
int number=scan.nextInt();
if(number%2==0){
System.out.println("EVEN");
}
else{
System.out.println("ODD");
}
}
}
Comments
Leave a comment