C If Statement Incorrect Evaluation Stack Overflow

C If Statement Incorrect Evaluation Stack Overflow