Finding Odd And Even

CFML has no Odd() or Even() function (although you could write your own as UDF’s). To determine if a number is odd or even simply use the MOD operator to divide it by 2 – if the remainder is 1 it is odd, if 0 it is even. (Applies to: ColdFusion All)

Leave a Reply