HackerRank Calculate the Nth term in c problem solution - TheCScience