Where does the program get its input from? Are they entered by a user?
The code I posted shows a way to determine if a number is even or odd.
Here is another example:
int val = 4; //...
Type: Posts; User: Norm
Where does the program get its input from? Are they entered by a user?
The code I posted shows a way to determine if a number is even or odd.
Here is another example:
int val = 4; //...
Test the lower order bit of an int to determine if it is odd or even. If the bit is 1, it is odd. Use the AND operator (&) with a 1.
For example:
System.out.println("odd " + (3 & 1) + ",...