Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 132 - 2505_CoreGPT(Podar)_Flipbook_C5
P. 132

    Arithmetic Operators

                      Scratch has four operators that allow you to do arithmetic calculations. These are
                      addition, subtraction, multiplication and division. Look at the code to use addition

                      block.

                                                            Addition

                                                            Using the addition operator

                      Similarly, you can use the other blocks to perform subtraction                     , multiplication
                                and division          .

                      Relational Operators

                      Scratch has three operators that allow you to compare the relationship between
                      two values or variables. These operators are used with conditional blocks. It will

                      compare two numbers and decide whether it is true or false. In the example below,
                      if the comparison is true, the program will go down to the next line of the code and

                      do what is there. If the comparison is false then the code will not execute.
                      The three relational operators are:

                                                 Operator                              Example

                                   1.  greater than

                    130     Premium Edition-V

| 127 128 129 130 131 132 133 134 135 136 137 |