Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

test for even and odd numbers (See related posts)

if( x%2 == 0)
{
  print "even number"
}
elsif( x%2 > 0)
{
  print "odd number"
}

Comments on this post

stancell posts on Sep 23, 2006 at 13:55
if( x%2 == 0) {
  print "even number"
} else {
  print "odd number"
}

You need to create an account or log in to post comments to this site.


Click here to browse all 4861 code snippets

Related Posts