Understanding Nested If Statements In C