You haven’t learned about statements that check on and respond to true/false (known as boolean) values yet, but since we are talking about arithmetic symbols we wanted to give you a primer with the symbols used for these checks.

You can check if two values are equal == (notice there are double =s to check for equivalency rather than the single symbol used for assignment), not equal !=, greater than >, greater than or equal >=, less than <, and less than or equal <=.

As an example, if you wanted to perform a segment of code if a had the same value as b, you could write it as:

int a = 3; int b = 3; if (a == b) { a++; }

Notice in this code that at the end, a would be 4.



The code block is ready for your new knowledge to fix this bad code. Insert the missing symbol(s) in the if statement so that the logic inside the check runs and the output is printed.

Note: You will more about if statements in a future lesson, for now you want the statement inside of it to be a true statement. So you want to use logical symbol(s) such that the comparison between x and y is a true statement.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?