Algorithm and Flowchart.

What is Algorithm ?

  • A sequential solution of any program called an algorithm written in human language.
  • Algorithm is first step of the solution process, after the analysis of problem, programmer write the algorithm of that problem.
  • An algorithm is a finite sequence of instructions, a logic and explicit step-by-step procedure for solving a problem.
Procedure to write an Algorithm..
  • The number of instructions must be finite
  • To write the algorithm you first must know how to solve the problem!
  • The solution must follow a logical pat
  • The order of the instructions IS

Example

step 1 : start
step 2 : input number
step 3 : rem=number mod 2
step 4 : if rem=0 then
               print "number even"
           else
               print "number odd"
           end
step 5 : stop

More Example:-

What is Flowchart ?

  • Graphical representation of any program is called flowchart.
  • A flowchart is a graphical representation of an algorithm.
  • There are some standard graphics that are used in flowchart as following:


Start / Stop terminal box flowchart symbol
Figure: Start/Stop terminal box


Input/output flowchart symbol
Figure: Input/Output box


Process / Instructions box flowchart symbol
Figure: Process/Instruction box


Lines or Arrows to show the flow of flowchart
Figure: Lines or Arrows


Decision box flowchart symbol
Figure: Decision box


Connector box flowchart symbol
Figure: Connector box


Comment/Expression flowchart symbol
Figure: Comment box


Preparation flowchart symbol
Figure: Preparation box


Separate flowchart symbol
Figure: Separate box

Post a Comment

Previous Post Next Post