Hi, I am working on a JAVA if problem. Basically it checks if the number inputted is larger than 0. If it is, it does another IF statement which checks if the number is even or odd and returning 0 or 1 respectively. Either one should then return to the original IF problem but with half the n value. Here is what i done but it does not seem to work and returns errors:
static String test(int n) {
if (n >0)
{
if (n%2 == 0)
return 1; n+test(n%2);
else
return 0; n+test(n%2);
}
else
return;
}
Thanks.