Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //check if a number is even
- public bool IsItEven(int number) {
- return number % 2 == 0;
- }
- //shorter version
- public static bool IsEven(int number) => number % 2 == 0;
- //shitty way to do it as the if which is a bool check checks the bool check
- public bool EvenNumber(int num) {
- if (num % 2 == 0) {
- return true;
- } else {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement