Logic Problem using If Statement

Please post your code.