C++_Operators_Presentation
C++_Operators_Presentation
OPERATORS
AN IN-DEPTH GUIDE WITH DIAGRAMS AND EXAMPLES
INTRODUCTION
• Examples:
• + (Addition)
• - (Subtraction)
• * (Multiplication)
• / (Division)
• % (Modulus)
• Example Code:
• int a = 10, b = 5;
• cout << (a + b); // Output: 15
RELATIONAL OPERATORS
• Examples:
• == (Equal to)
• != (Not equal to)
• > (Greater than)
• < (Less than)
• >= (Greater or equal)
• <= (Less or equal)
• Example Code:
• int x = 5, y = 10;
• if (x < y) {
• cout << 'X is smaller';
• }
LOGICAL OPERATORS
• Examples:
• && (Logical AND)
• || (Logical OR)
• ! (Logical NOT)
• Example Code:
• bool a = true, b = false;
• if (a && b) {
• cout << 'Both True';
• } else {
• cout << 'False';
• }
FLOWCHART: ARITHMETIC
OPERATIONS
• A simple flowchart for arithmetic operations.
• (Flowchart to be added manually in PowerPoint)
CONCLUSION