Skip to content

Instantly share code, notes, and snippets.

@mikeschinkel
Created October 2, 2010 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeschinkel/607122 to your computer and use it in GitHub Desktop.
Save mikeschinkel/607122 to your computer and use it in GitHub Desktop.
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