Which of the following is good coding practice to determine oddity?
i)
public boolen abc(int num){return num % 2 == 1;}

ii)
public boolean xyz(int num){return (num & 1)!= 0; }

Which of the following is good coding practice to determine oddity?
i)

public boolen abc(int num){return num % 2 == 1;}

ii)
public boolean xyz(int num){return (num & 1)!= 0; }
Correct Answer ii

Related Questions

Consider the 5 × 5 matrix \[{\text{A}} = \left[ {\begin{array}{*{20}{c}} 1&2&3&4&5 \\ 5&1&2&3&4 \\ 4&5&1&2&3 \\ 3&4&5&1&2 \\ 2&3&4&5&1 \end{array}} \right
What is the right choice, if the following loop is implemented?
void main(){ int num = 0; do{ --num; printf("%d", num); }while( ++num >= 0 );}