Fix the Error: Check Whether a Given Number Is Odd

Published by Mubashir Hassan in

Mubashir has written the function isOdd() to check if a given number is odd or not. Unfortunately, the function does not return the correct result for all the inputs. Help him fix the error.

Bool isOdd(num) {
  num%2==1;
}

Examples

isOdd(-5) ➞ true

isOdd(25) ➞ true

isOdd(0) ➞ false

Notes

All the inputs will only be integers.

Watch a quick demo on how Edabit works.