In this guide, we will discuss Equality and Relational Operators in Dart Programming Language.
Example
The following example shows how you can use Equality and Relational operators in Dart −
void main() { var num1 = 5; var num2 = 9; var res = num1>num2; print('num1 greater than num2 :: ' +res.toString()); res = num1<num2; print('num1 lesser than num2 :: ' +res.toString()); res = num1 >= num2; print('num1 greater than or equal to num2 :: ' +res.toString()); res = num1 <= num2; print('num1 lesser than or equal to num2 :: ' +res.toString()); res = num1 != num2; print('num1 not equal to num2 :: ' +res.toString()); res = num1 == num2; print('num1 equal to num2 :: ' +res.toString()); }
It will produce the following output −
num1 greater than num2 :: false num1 lesser than num2 :: true num1 greater than or equal to num2 :: false num1 lesser than or equal to num2 :: true num1 not equal to num2 :: true num1 equal to num2 :: false
Next Topic : Click Here
Pingback: Dart Programming - Operators | Adglob Infosystem Pvt Ltd