Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 112 - 2609_Logiccode
P. 112

    If we change the value of the variable num to -6 in the set to block, no output will be shown
                      because the condition becomes false.

                      Let us create another project to check whether a number is even or odd using the if-then-else
                      block. Follow the given steps to do so:

                                                                         3  Drag the set to block and drop
                                                                         it inside the on start block.

                           1  Click on the Variables
                          blocks category.

                                                                2  Create a variable      4  Type 5 in the value box of the
                                                                named number.            set to block to set the value of the
                                                                                         number variable to 5.

                      110   Premium Edition-VII

| 107 108 109 110 111 112 113 114 115 116 117 |