Page 118 - TP_Prime_v2.2_Class_6
P. 118

B. Algorithm to compare two numbers.
                  Step 1:   Start.

                  Step 2:  Read two numbers and store them in A and B.

                  Step 3:  Compare the numbers A and B.

                  Step 4:  If A is less than B, print "A is smaller" and go to Step 7.

           Prime (Ver. 2.2)-VI  Step 6:  If A is equal to B, print "A and B are equal".
                  Step 5:  If B is less than A, print "B is smaller" and go to Step 7.


                  Step 7:  Stop.


                    Defining Flowcharts


                  A flowchart is a type of graphical diagram that represents an algorithm. It is a set of
                  instructions that can be followed to perform a specific task, workflow, or process. This
          116     diagrammatic representation illustrates a solution model for a given problem. Flowcharts

                  are used in analysing, designing, documenting, or managing processes or programs in various
                  fields.

                  Flowcharts show  the  sequence  of  instructions  in  a  program.  They  play  a  vital  role  in
                  programming by helping to understand the logic of complicated and lengthy problems.
                  Once  a  flowchart  is  drawn,  it  becomes  easy  to  write  the  program  in  any  high-level
                  language. Flowcharts are also helpful in explaining the program to others. Thus, it is
                  accurate to say that a flowchart is essential for a better understanding of a complex
                  program.


                     Symbols used in Flowcharts


                  Different symbols are used to draw different types of flowcharts. Let us discuss them.

                          Name             Symbol                               Description

                                                       It indicates the start and stop points of the flowchart.
                   (Start/Stop)
                                                       It usually contains the words 'Start' or 'Stop'.
                                                       It shows  a  process  or action step.  This  is the  most
                   Process
                                                       common symbol used in flowcharts.

                                                       It indicates a question or branch in the process flow. It
                   Decision
                                                       is used when there are 2 options (Yes/No).


                                                       It represents material or information entering or leaving
                   Input/Output
                                                       the system, i.e., input and output.
   113   114   115   116   117   118   119   120   121   122   123