Skip to content

Instantly share code, notes, and snippets.

@ayeshLK
Created January 4, 2022 19:59
Show Gist options
  • Save ayeshLK/ffcd23c42b1e7561411d5700ee3a6dd3 to your computer and use it in GitHub Desktop.
Save ayeshLK/ffcd23c42b1e7561411d5700ee3a6dd3 to your computer and use it in GitHub Desktop.
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