Project Euler problem 10 i C