Arithmetic operators are +, -, *, /and %. They are used for the basic arithmetic operations known from mathematics. As known from mathematics, these are exclusively binary operators. Binary operators are operators that each require exactly two values or variables. There must be a value or a variable on both sides of binary operators – otherwise the compiler will report an error. The arithmetic operators enable the four basic arithmetic operations to be carried out: + Values or variables can be added with, – subtracted with, * multiplied with and / divided with. The operator % is the modulo operator: It performs just like /a division but returns the integer remainder of the division as the result. Logical operators make it possible to link truth values. The logical operators & and ||are binary operators, the logical operator! is a unary operator. Unary operators expect only one operand, while binary operators expect two operands. The bitwise operators &, |, ~, ^, «and » enable the setting, clearing, and shifting bits. In the book Fundamentals of programming is the importance of &, |, ~and ^discussed in detail. These are the bitwise AND, OR, NOT, and EXCLUSIVE OR operators. In the context of this book, the bitwise operators are not presented in detail, as they are only required for very specific operations for processing bits that are not crucial for learning the C ++ programming language. As the name suggests, comparison operators enable values and variables to be compared. You can with the operators ==, !=, >, <, >=and <=check-DC Small for equality, inequality, greater than or less than or Greater than or equal or. All comparison operators are binary operators. Relational operators return a truth value as the result – either true or false. The result depends on whether the comparison is correct or not. Combined assignment operators are assignment operators that are combined with other operators. The sense and purpose is ultimately an abbreviated notation for shorter, clearer code.
Operator
January 16, 2023 · 2 min · 328 words · Charles Ruth