I'm trying to do a class exercise, I'm a rookie in java and this is my second task.
The statement is this:
Make a Java program that asks the user for a whole number. After processing it, the program informs if the number is divisible by 2 or it is not
I have done this, but to put it for example 2 or 1 says that it is not a divisor, to have if you can lend me a hand of what is missing:
import java.util.Scanner;
public class operador_interrogante {
public static void main(String[] args) {
int num;
byte divisor = 2;
int division;
Scanner teclado = new Scanner(System.in);
System.out.println("Introduce un numero entero");
num = teclado.nextInt();
division = num/=divisor;
if (divisor == division){
System.out.println("Son divisores");
}else{
System.out.println("No son divisores");
}
}
}