All exercises of Kernighan and Ritchie done by me