You can do it even even faster by replacing your if statements (works because the ascii values end in the digit they represent):
if (d & 1) printf("odd\n"); else printf("even\n")