Page 110 - Plus_V2.2_C6_Flipbook
P. 110

Program 1: To perform all the arithmetic operators.




























                  The result of the above program is:























                       Assignment Operators

                  The assignment operators are used to assign the value of the right expression to the left operand. The
                  assignment operators are described in the following table:

                   Operator Name               Description                                                   Example

                       =      Assignment       It assigns the value of operand on the right side to the left   x = 5
                                               side operand.
                       +=     Addition         It adds right operand to the left operand and assigns the       x += 3
                              assignment       result to left operand. x+=3 is equivalent to x=x+3.

                       –=     Subtraction      It subtracts right operand from the left operand and assigns   x –= 3
                              assignment       the result to left operand. x–=3 is equivalent to x=x–3.
                       *=     Multiplication   It multiplies right operand with the left operand and assigns   x *= 3
                              assignment       the result to left operand. x*=3 is equivalent to x=x*3.



                  108   Premium Edition-VI
   105   106   107   108   109   110   111   112   113   114   115