Relational & Comparison Operators

🟢 Beginner

📖 Definition

Relational operators compare two operand expressions and return a bool (true or false): equal (==), not equal (!=), greater than (>), less than (<), greater or equal (>=), and less or equal (<=).

💡 Code Example

#include <iostream>

int main() {
    int x = 10, y = 20;
    std::cout << std::boolalpha;
    std::cout << "x < y : " << (x < y) << "\n";
    std::cout << "x == y: " << (x == y) << "\n";
    return 0;
}