Skip to content

Latest commit

 

History

History
72 lines (58 loc) · 1.14 KB

comparison.md

File metadata and controls

72 lines (58 loc) · 1.14 KB

Home

Comparison

Operator Name
== Equal to
!= Not equal to
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to

Equal to example

if x == y;
    print "x equals y";
else; 
    print "x does not equal y";
end;

Not equal to example

if x != y;
    print "x does not equal y";
else; 
    print "x equals y";
end;

Less than example

if x < y;
    print "x is less than y";
else; 
    print "x is greater than or equal to y";
end;

Greater than example

if x > y;
    print "x is greater than y";
else; 
    print "x is less than or equal to y";
end;

Less than or equal to example

if x <= y;
    print "x is less than or equal to y";
else; 
    print "x is greater than y";
end;

Greater than or equal to example

if x >= y;
    print "x is greater than or equal to y";
else; 
    print "x is less than y";
end;