Page 93 - Plus_V2.2_C6_Flipbook
P. 93

Example 2: Flowchart to accept a number and display the square of it.

                                                                  Start




                                                             Input a number



                                                           Square = number *
                                                                number


                                                               Print Square




                                                                  Stop

                                                     Flowchart to accept a number
                                                       and display the square of it


                        SOLVING PROBLEMS USING ALGORITHMS AND FLOWCHARTS



                 Example 1: Write an algorithm and draw a flowchart to accept the marks, and if marks are greater
                 than 40, display pass; otherwise, display fail.
                 Algorithm:                                 Flowchart:

                 Step 1:  Start                                                      Start
                 Step 2:  Read the marks
                 Step 3:  Check if marks > 40 Then
                         print "You are pass"                                     Input marks
                         Else
                         print "You are fail"

                 Step 4:  Stop
                                                                   False               Is
                                                                                 marks < = 40?




                                                                                         True

                                                     Print "You are fail"      Print "You are pass"




                                                                                     Stop








                                                                                           Algorithm and Flowchart  91
   88   89   90   91   92   93   94   95   96   97   98