Relational Operator

In computer science, a relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities. These include numerical equality (e.g., 5 = 5) and inequalities (e.g., 4 ≥ 3). In programming languages that include a distinct boolean data type in their type system, like Java, these operators return true or false, depending on whether the conditional relationship between the two operands holds or not. In other languages such as C, relational operators return the integers 0 or 1.

An expression created using a relational operator forms what is known as a relational expression or a condition. Relational operators are also used in technical literature instead of words. Relational operators are usually written in infix notation, if supported by the programming language, which means that they appear between their operands (the two expressions being related). For example, an expression in C will print the message if the x is less than y:

if (x < y) { printf("x is less than y in this examplen"); }

Other programming languages, such as Lisp, use prefix notation, as follows:

(>= X Y)

Read more about Relational OperatorStandard Relational Operators

Other articles related to "relational operator, relational operators":

operators" class="article_title_2">Standard Relational Operators
... The most common numerical relational operators used in programming languages are shown below ... Common relational operators Convention equal to not equal to greater than less than greater than or equal to less than or equal to In print = ≠ > = = ...