Say I want to style posts with a different background color depending on whether they're odd or even. I'm thinking, in terms of pseudo-code, something like this:
if ((post-id % 2) == 0)
<div class="even">
else
<div class="odd">
But how do I do this in a PHP Wordpress template?