exercise in <C programing language>