You might want to write this as
Originally Posted by The Brain
since not everyone knows off the top of their head that && has higher precedence than || (I had to look it up).
if (year%400 == 0 || (year%4 == 0 && year%100 != 0))
Edit: If efficiency matters, you can also rewrite it as
since the first condition is much more likely to be true, allowing the || shortcutting to skip the second condition. The two conditions for && should be left as is, since the first one is much more likely to be false, allowing the && shortcutting to skip the second one.
if ((year%4 == 0 && year%100 != 0) || year%400 == 0)