Page 62 - Touchcode_C8_Flipbook
P. 62

The value of the first element of the array is stored in temp.
                                 Value of second element is placed in first element.
                                 Now the value of second element is placed in temp.

                                  At this stage, the comparison of the values of the element is done and the
                                 values are swapped.
                                 Value is incremented to 1. (2nd item).

                                 Value is incremented to 1. (3rd item).
                                 The value of k is less than array.
                                 Values are compared and printed.

                   Step 6:  Click on the ‘start the simulator’ button          , to view the output.





























                      Well done, you have learnt to implement sorting in MakeCode Arcade.





                    Coding           uiz   04                                                           Critical Thinking



                      Give one word answer to the following questions.

                      a.  What is the main purpose of using functions?                                .......................

                      b.  What does function returns when an operation is performed inside

                          a function?                                                                 .......................









                   60     Touchcode-VIII
   57   58   59   60   61   62   63   64   65   66   67