Check odd using bit operator
Java
Easy
4 views
Problem Description
Task: return true if x is odd using bitwise operator.
Output Format
Return value
Constraints
Handle negative too.
Official Solution
static boolean isOdd(int x){return (x & 1)!=0;}
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!