Question: 21
Which of the following functions will correctly return true if it is passed an odd integer value for x?
I.
function IsOdd (x) {
return (x % 2 == 1);
}
II.
functionl IsOdd (x) {
return (x / 2 == 1);
}
III.
function IsOdd (x) {
if (x % 2 == 1)
return true;
else
return false;
}
I, II, and III
II only
I and II only
I and III only
1 answer
I and III only