# Relational operators

We can use relational operators when we want to compare two variables. In the following table, we can see the relational operators in Dart:

Name | Operator | Description |
---|---|---|

Equal to | `a == b` | Check if `a` is equal to `b` |

Not equal to | `a != b` | Check if `a` is not equal to `b` |

Greater than | `a > b` | Check if `a` is greater than `b` |

Less than | `a < b` | Check if `a` is less than `b` . |

Less or equal to | `a <= b` | Check if `a` is less or equal to `b` |

Greater or equal to | `a >= b` | Check if `a` is greater or equal to `b` |

With **equal to (==)** and **not equal to (!=)**, we can check if two variables are equal or not equal, for example:

`int a = 10;`

int b = 15;

if (a == b) {

print('a is equal to b');

}

if (a != b) {

print('a is not equal to b');

}

Sometimes we also want to know if the variable is **greater than** or **less than**. To do it we can use
the rest of the operators, for example:

`int a = 10;`

int b = 15;

if (a > b) {

print('a is greater than b');

}

if (a < b) {

print('a is less than b');

}

if (a >= b) {

print('a is greater or equal to b');

}

if (a <= b) {

print('a is less or equal to b');

}

Let's take a look at the previous examples in DartPad: