Created
October 1, 2010 23:56
-
-
Save mikeschinkel/607075 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
switch (n) | |
{ | |
case 0: | |
echo "You typed zero."; | |
case 1: | |
case 4: | |
case 9: | |
echo "n is a perfect square."; | |
case 2: | |
echo "n is an even number."; | |
fallthru; | |
case 3: | |
case 5: | |
case 7: | |
echo "n is a prime number."; | |
fallthru; | |
case 6: | |
case 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