Created
January 4, 2022 19:59
-
-
Save ayeshLK/ffcd23c42b1e7561411d5700ee3a6dd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isDivisibleByFive(int number) returns string { | |
int lastDigit = number / 10; | |
match lastDigit { | |
// check whether last digit is `0` or `5` | |
0|5 => { | |
return "Divisible by Five"; | |
} | |
_ => { | |
return "Not Divisible by Five"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment