I'm trying to do this:
(number % 2 == 0) ? return 1 : return 0;
But it doesn't work, does someone know why?
You should write this way:
return (number % 2 == 0) ? 1 : 0;