8.1k views
1 vote
In 1–2 sentences describe the purpose of comparison operators and give an example.

User Septnuits
by
9.2k points

1 Answer

5 votes
comparison operators are used to compare between objects!
are they equal? is one greater than the other?

if (a == b) ++a;
if (a > b) a = b;

for example when we use a sort function, comparison operators are used inside the function.

User That Marc
by
7.9k points

No related questions found