identify the input that is multiple of 11 and odd or even java
- by Bolor Ch
i am trying to write code to determine the nature of input using if statement only. The nature of input could be following:
a multiple of 11
even or odd.
For the code below, when I enter my input, it does not display the result as "input:NOT:ODD". Also how can I check multiple conditions with if statement? (else is not considered)
import java.util.Scanner;
public class test
{
public static void main( String args[] )
{
Scanner input = new Scanner( System.in );
int x;
int EO;
int Mult;
System.out.print ( "Enter value: " );
x = input.nextInt();
EO = x % 2;
Mult = x % 11;
if (EO > 0 && Mult > 0)
{
System.out.printf ("%d:NOT:ODD");
}
}
}