Question
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
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
Answers
There are no human answers yet.
Answered by
GPT 3.5
I and III only
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.