Created
April 28, 2021 08:09
-
-
Save un-ro/34bac7c93d7de63b297a003a19bccaf1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Fizz Buzz | |
| fun fizzBuzz(start: Int, end: Int){ | |
| for (i in start..end) { | |
| if ((i % 3 == 0) && (i % 5 == 0)) { | |
| print("Fizz Buzz, ") | |
| } else if (i % 3 == 0) { | |
| print("Fizz, ") | |
| } else if (i % 5 == 0) { | |
| print("Buzz, ") | |
| } else { | |
| print("$i, ") | |
| } | |
| } | |
| } | |
| fun main() { | |
| fizzBuzz(1, 30) | |
| } |
Author
un-ro
commented
Feb 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment