CBSE Class XI :- Operators in C++

1,093 views

Published on

Published in: Education, Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,093
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
55
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

CBSE Class XI :- Operators in C++

  1. 1. OperatorsOperators inin C ++C ++ Made By:- Pranav GhildiyalMade By:- Pranav Ghildiyal Class :- ‘XI’ ‘B’Class :- ‘XI’ ‘B’
  2. 2. ARITHEMATIC OPERATORS PLEASE NOTE :- C+ + is case- sensitive a , A both are different Unary plus A= 5A= 5 Unary minus -A = -5-A = -5
  3. 3. INCREMENT AND DECREMENT OPERATORINCREMENT AND DECREMENT OPERATORINCREMENT AND DECREMENT OPERATORINCREMENT AND DECREMENT OPERATOR • These operators increase or decrease the value of the operand by 1 • Increment increases by 1 while the decrement decreases by 1 PREFIX VERSION It follows the change then use rule i.e., it first changes the value of the operand and then use the new value to evaluate the expression POSTFIX VERSION It follows the use then change rule i.e., it first uses the new value of the operand in evaluating the expression and then changes the operands value
  4. 4. . Operators that act upon two operands are known as binary operators
  5. 5. Relational operators refer to the relationship that values can have with one another . Relational operators don’t work with string. We can compare numbers and characters with them. If the comparison results in true , the relational operators results in the value 1 else it results in the value 0 (comparison results in false).
  6. 6. LOGICAL OPERATORSLOGICAL OPERATORS Logical AND The resulting expressions gives the value 1 only if both the original operands are true Logical OR The resulting expressions gives the value 1 if either of the original operands is true Logical NOT It is a unary operator. It reverses the truth value of the expression and gives true if the expression is false 11 Logical OR and Logical AND has lower precedence than relational operatorsLogical OR and Logical AND has lower precedence than relational operators 22 Logical NOT has higher precedence over any relational or arithimatic operatorLogical NOT has higher precedence over any relational or arithimatic operator Facts about operatorsFacts about operators
  7. 7. CONDITIONAL OPERATOR ( ? : ) OR TERNARY OPERATORCONDITIONAL OPERATOR ( ? : ) OR TERNARY OPERATORCONDITIONAL OPERATOR ( ? : ) OR TERNARY OPERATORCONDITIONAL OPERATOR ( ? : ) OR TERNARY OPERATOR
  8. 8. SOME OTHER OPERATORSSOME OTHER OPERATORS COMPILE TIME OPERATOR • It returns the length (in bytes) of the variable / type specified COMMA OPERATOR IntegerInteger 2 Bytes2 Bytes CharacterCharacter 1 Bytes1 Bytes FloatFloat 4 Bytes4 Bytes DoubleDouble 8 Bytes8 Bytes • It is used to string together several group of expressions. The result of the rightmost expression becomes the value of the total comma seprated expression
  9. 9. SOME OTHER OPERATORSSOME OTHER OPERATORS COMPILE TIME OPERATOR • It returns the length (in bytes) of the variable / type specified COMMA OPERATOR IntegerInteger 2 Bytes2 Bytes CharacterCharacter 1 Bytes1 Bytes FloatFloat 4 Bytes4 Bytes DoubleDouble 8 Bytes8 Bytes • It is used to string together several group of expressions. The result of the rightmost expression becomes the value of the total comma seprated expression

×