AtegonA to Programmer Humor · 1 year agoHow to detect if a number is evenimagemessage-square18fedilinkarrow-up169arrow-down13
arrow-up166arrow-down1imageHow to detect if a number is evenAtegonA to Programmer Humor · 1 year agomessage-square18fedilink
minus-squarejeff 👨💻linkfedilinkarrow-up15·1 year agobool isEven(int num) { return !isOdd(num); } bool isOdd(int num) { return !isEven(num); }
minus-squareSpylinkfedilinkarrow-up1·1 year agoLegends say this code runs faster than what the op posted. StackOverflow Errors are surprisingly fast in most languages
bool isEven(int num) { return !isOdd(num); } bool isOdd(int num) { return !isEven(num); }
Legends say this code runs faster than what the op posted. StackOverflow Errors are surprisingly fast in most languages