k&r; exercise 1.1 - add tests