Page 76 - Touchcode_C8_Flipbook
P. 76

Start


                                                                 i=0
                                                                    Condition

                                                                              No
                                                                i<100?                    Stop


                                                                     Yes

                                                                r=r%3


                                   Loop                         i=i+1                 Iteration
                                                                    Condition
                                                      No
                                                                 r=0?


                                                                     Yes

                                                                Print i

                  To print all the numbers divisible by 3 between 0 and 100, the flow of the program will

                  iterarte again and again and test if the number is divisible by 3. If the number is divisible by
                  3 then then the number will be printed and the rest of the numbers will be ignored.



                                                                                                    Experiential Learning
                                                       Coding Task          01


                                          To print number divisible by 3 from 1 to 100

                   In this task, you will learn to create the program which checks and print the number
                   divisible by 3.

                   To perform the task, follow these steps:

                   Step 1:  Visit the link: https://arcade.makecode.com/. Create a

                             project ‘Divisibility by 3’, and click on ‘Create’.
                   Step 2:  Create a variable ‘number’.

                   Step 3:  From ‘Game’ select the ‘splash’ block. Write the

                             message ‘Number  that  are  divisible  by  3’.  Drop  the
                             ‘splash’ block to ‘on start’ block.






                   74     Touchcode-VIII
   71   72   73   74   75   76   77   78   79   80   81