nested if else statement in cpp