Ategon to Programmer [email protected] • 2 years agoHow to detect if a number is evenprogramming.devimagemessage-square20fedilinkarrow-up170arrow-down12
arrow-up168arrow-down1imageHow to detect if a number is evenprogramming.devAtegon to Programmer [email protected] • 2 years agomessage-square20fedilink
minus-square@[email protected]linkfedilink3•2 years agoprivate void GenerateCode(){ println("private bool IsEven(int number){"); println("if (number == 1) return false"); for(int i == 2; true; i += 2){ println("if (number == " + i.tostring() + " return true"; println("if (number == " + (i + 1).tostring() + " return false"; } }
private void GenerateCode(){ println("private bool IsEven(int number){"); println("if (number == 1) return false"); for(int i == 2; true; i += 2){ println("if (number == " + i.tostring() + " return true"; println("if (number == " + (i + 1).tostring() + " return false"; } }