Rev Up for Success with the 2026 OCR GCSE Computer Science Paper 2 Practice Extravaganza!

Question: 1 / 400

Which operator compares two values and outputs either true or false?

Arithmetic operator

Comparison operator

The option that refers to the comparison of two values, resulting in a true or false output, is the comparison operator. Comparison operators are used in programming to evaluate conditions, such as determining if one value is greater than, less than, equal to, or not equal to another value. These operators form the basis of decision-making in programs, allowing them to execute different code pathways based on the results of the comparisons.

For instance, in a programming context, you might use a comparison operator to check if a user's input meets a certain criterion, like whether a number is greater than 10. The output of this operation would be either true (if the condition is met) or false (if it is not), guiding subsequent actions within the code.

The other types of operators listed do not serve this purpose. Arithmetic operators focus on mathematical calculations, logical operators assess the truth values of expressions, and assignment operators are used to assign values to variables. None of these directly compare two values in the manner described in the question.

Get further explanation with Examzify DeepDiveBeta

Logical operator

Assignment operator

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy