?
Which of the following is good coding practice to determine oddity?
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;
}
public boolen abc(int num)
{
return num % 2 == 1;
}public boolean xyz(int num)
{
return (num & 1)!= 0;
}
Join the Discussion
Login to post a comment or share your explanation.
Login