Created
October 2, 2010 00:55
-
-
Save mikeschinkel/607122 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
case (n) | |
{ | |
when 0: | |
echo "You typed zero."; | |
when 1: | |
when 4: | |
when 9: | |
echo "n is a perfect square."; | |
when 2: | |
echo "n is an even number."; | |
fallthru; | |
when 3: | |
when 5: | |
when 7: | |
echo "n is a prime number."; | |
fallthru; | |
when 6: | |
when 8: | |
echo "n is an even number."; | |
default: | |
echo "Only single-digit numbers are allowed."; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment