C programming language exercise