Add C code and test for Harry Potter exercise