I have a piece of code which is supposed to determine whether or not a number is even or odd.
If I add return false it prints out that all the numbers between 1 and 25 odd.
What should I change?
public class CS1702_Lab8 {
public static void main(String args[])
{
int i;
boolean eo;
String s = "";
for(i=1;i<=25;++i)
{
eo = EvenOdd(i);
s = (eo)?"Even":"Odd";
System.out.println(i + " is " + s);
}
}
public static boolean EvenOdd(int x)
{
return false;
}
}
If I add return false it prints out that all the numbers between 1 and 25 odd.
What should I change?