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
Similar Questions
  1. which of the following is not needed to call a functiona. the functions name b. an understanding of the functions parameters c.
    1. answers icon 1 answer
  2. Consider the following code.public static int recur3(int n) { if (n == 0) return 0; if (n == 1) return 1; if (n == 2) return 2;
    1. answers icon 2 answers
    1. answers icon 1 answer
    1. answers icon 1 answer
more similar questions