nave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 1 year agoI wishi.imgur.comexternal-linkmessage-square150fedilinkarrow-up1707arrow-down116
arrow-up1691arrow-down1external-linkI wishi.imgur.comnave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 1 year agomessage-square150fedilink
minus-squareJohanno@feddit.delinkfedilinkarrow-up13·1 year agoStackoverflowException. What do I do now? Nvm. Got it. if(num % 2 == 0){ int num1 = num/2 int num2 = num/2 return isEven(num1) && isEven(num2) } if(num % 3 == 0){ int num1 = num/3 int num2 = num/3 int num3 = num/3 return isEven(num1) && isEven(num2) && isEven(num3) } Obviously we need to check each part of the division to make sure if they are even or not. /s
StackoverflowException.
What do I do now?
Nvm. Got it.
if(num % 2 == 0){ int num1 = num/2 int num2 = num/2 return isEven(num1) && isEven(num2)
}
if(num % 3 == 0){ int num1 = num/3 int num2 = num/3 int num3 = num/3 return isEven(num1) && isEven(num2) && isEven(num3) }
Obviously we need to check each part of the division to make sure if they are even or not. /s