Hackerrank If Else Solution C