Project Euler problem 8 in C