Operand<\/a>:- on which operation is to be performed.<\/strong><\/p>\n\n\n\nExpression:- combination of operator and operands.<\/strong><\/p>\n\n\n\n<\/p>\n\n\n\n
There are following types of operators in C++ language that perform different operation.<\/p>\n\n\n\n
- Arithmetic operators +,-,*,\/,%<\/strong><\/li>
- Relation operators >,<, >=,<=,= =, !=<\/strong><\/li>
- Logical operators && ,|| ,!<\/strong><\/li>
- Assignment operator =<\/strong><\/li>
- Increment \/ Decrement operator ++, – –<\/strong><\/li>
- Bitwise operators &, |,^, ~, <<, >><\/strong><\/li>
- Special operators sizeof(), comma<\/strong><\/li>
- Conditional or Ternary operator ? :<\/strong><\/li><\/ul>\n\n\n\n
Note:- <\/p>\n\n\n\n
There are three category of Operators in C++.<\/p>\n\n\n\n
- Unary operator:- which Requires one operand to operate.<\/li><\/ol>\n\n\n\n
Ex.. increment (++) and Decrement (- -) etc.<\/p>\n\n\n\n
2. Binary operator:- Which Requires two operands to operate.<\/p>\n\n\n\n
Ex….. Arithmetic,Relational,Logical ,..etc<\/p>\n\n\n\n
3. Ternary operator :- which requires three operands to operate.<\/p>\n\n\n\n
ex…Ternary operator.<\/p>\n\n\n\n
<\/p>\n\n\n\n
- Arithmetic operators: – The operators that are used for arithmetic calculations, known as Arithmetic operators.<\/strong><\/li><\/ol>\n\n\n\n
Symbol……………………… Purpose<\/p>\n\n\n\n
+\u2026\u2026\u2026\u2026\u2026\u2026. Addition<\/p>\n\n\n\n
-\u2026\u2026\u2026\u2026\u2026\u2026\u2026..Subtraction<\/p>\n\n\n\n
*\u2026\u2026\u2026\u2026\u2026\u2026\u2026..Multiplication<\/p>\n\n\n\n
\/\u2026\u2026\u2026\u2026\u2026\u2026\u2026..Division<\/p>\n\n\n\n
%……………………….Modulo<\/p>\n\n\n\n
2. Relational operators: – These operators are used for comparison. These are also called comparison operators.<\/strong><\/p>\n\n\n\nSymbol……………………….Purpose<\/p>\n\n\n\n
>\u2026\u2026\u2026\u2026\u2026\u2026. Greater than<\/p>\n\n\n\n
<\u2026\u2026\u2026\u2026\u2026\u2026\u2026..Less than<\/p>\n\n\n\n
>=\u2026\u2026\u2026\u2026\u2026\u2026\u2026..Greater than or equal to<\/p>\n\n\n\n
<=\u2026\u2026\u2026\u2026\u2026\u2026\u2026..Less than or equal to<\/p>\n\n\n\n
= =……………………….Equal to<\/p>\n\n\n\n
!=\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026Not Equal to<\/p>\n\n\n\n
3. Logical operators: – These operators are used to combine or negate conditions.<\/strong><\/p>\n\n\n\nSymbol\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026Purpose<\/p>\n\n\n\n
&&\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026.Logical AND<\/p>\n\n\n\n
||\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026\u2026Logical OR<\/p>\n\n\n\n
!……………………………………… Logical NOT<\/p>\n\n\n\n
4. Assignment operator:- This operator is used to Assign value to a variable.<\/strong><\/p>\n\n\n\nEx.. a=5; <\/p>\n\n\n\n
\n
5. Increment or Decrement operator:- It is used to increase or decrease the value of a variable by one. It can be used in two ways.<\/strong><\/p>\n\n\n\n- Pre-Increment \\ Decrement:- when the operator is placed before the operands.<\/li><\/ol>\n\n\n\n
Example ++a, – -a;<\/p>\n\n\n\n