There are 4 types of C++ operators: arithmetic, assignment, comparison, and logical. Arithmetic operators perform math operations like addition and subtraction. Assignment operators assign values. Comparison operators compare values. Logical operators combine conditional statements. The document then provides examples of common operators from each category and describes their basic functions.
There are 4 types of C++ operators: arithmetic, assignment, comparison, and logical. Arithmetic operators perform math operations like addition and subtraction. Assignment operators assign values. Comparison operators compare values. Logical operators combine conditional statements. The document then provides examples of common operators from each category and describes their basic functions.
There are 4 types of C++ operators: arithmetic, assignment, comparison, and logical. Arithmetic operators perform math operations like addition and subtraction. Assignment operators assign values. Comparison operators compare values. Logical operators combine conditional statements. The document then provides examples of common operators from each category and describes their basic functions.
Arithmetic Assignment Comparison Logical Introduction to C++ Operators •Operators are used to perform operations on variable and values. For example, + is an operator used for addition, while – is an operator used for subtraction. Arithmetic Operators Operator Name Description Example + Addition Adds together two values x+y - Subtraction Subtracts one value from another x-y * Multiplication Multiplies two values x*y / Division Divides one value by another x/y % Modulus Returns the division remainder x%y Assignment Operators • = (Assignment) • += (Addition Assignment) • -= (Subtraction Assignment) • *= (Multiplication Assignment) • /= (Division Assignment) • %= (Modulus Assignment) Comparison Operators • == (Equal to) • != (Not equal to) • > (Greater than) • < (Less than) • >= (Greater than or equal to) • <= (Less than or equal to) Logical Operators • && (Logical AND) • || (Logical OR) • ! (Logical NOT)