Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 122 - 2609_Logiccode
P. 122

    Example
                       Operator Name                 Description                                 (x=7 and      Output
                                                                                                 y=3)

                           %       Modulus           Divides left hand operand by right hand  x % y            1
                                                     operand and returns remainder.

                           **      Exponentiation Performs exponential (power)                   x ** y        343
                                                     calculation on operands.

                           //      Floor or Integer  Divides and cuts the fractional part from  x // y         2
                                   division          the result.

                      Program: To perform the arithmetic operations.

                      On running the above program, you will get the following output:

                      ASSIGNMENT OPERATORS

                      The assignment operators are used to assign the value of the right expression to the left operand.

                      120   Premium Edition-VII

| 117 118 119 120 121 122 123 124 125 126 127 |