0
What is the work of OR operator
2 odpowiedzi
+ 4
The or operator is ||. Given two booleans a and b, (a || b) is true if and only if at least one of them is true.
Example:
/*checks if the point at coordinates (x, y)
is on the vertical or horizontal axis.*/
bool onAxis(int x, int y) {
if ((x == 0)||(y == 0)) {
return true;
}
return false;
}
0
Thanks you