what is algorithm and flowchart in programming

what is algorithm and flowchart in programming?

An algorithm and flowchart play a very important role in programming to create any program. Algorithm and flowchart are used by the programmer in programming to create very effective program. This feature help programmers to create program easily.an programmer generally create algorithm and flowchart before creating a program.

what is algorithm and flowchart in programming


what is algorithm?

word algorithm refers to the set of instructions or rules that must be followed before solving any problem.

an algorithm creates by programmer before creating any programm.an algorithm helps anyone to understand how does the program work.

there are some rules for create an algorithm:

 

Rule 1: it should start from word start.

Rule 2: it should end from word stop.

Rule 3: it should be effective.

Rule 4: it should have finiteness.

Rule 5: it should be easily understandable by anyone or programmer. 


Types of algorithms:

There are various types of algorithms are present, but the most important types of algorithms are. 

  • Brute force algorithm: the simplest approach to solve a particular problem is called as brute force algorithm.
  • Search algorithm: a search algorithm is a type of algorithm which is design to solve a search problem. Search engines like google, being also use search algorithms.
  • Sorting algorithms: a sorting algorithm is used to rearrange any list of elements in an array.
  • Randomized algorithm: a randomized algorithm is a type of algorithm which use random numbers or choices to decide the next step.
Example of algorithms:

Algorithm to add two numbers in c programming:
Step 1: start.
Step 2: input A, B
Step 3: compute sum=A+B
Step 4: display sum
Step 5: stop.

What is flowchart?


A flowchart is a graphical way to represent an algorithm. Or in other words a pictorial representation of algorithm is called flowchart. This is very effective way to understand how program does work.an flow chart is create by the programmer before the creation of the program.
with the help of flowchart everyone can easily understand about the program.

In flowchart the steps of algorithms are represented by different shapes.
All shapes are shown below:




                                          (It is the shape for terminal start or stop)

 

 

 




                                          (This arrow shape is use for flow line)

 

 

 

 

                                (Parabolic shape is use for input and output)

 

 

 

                                         (Diamond shape is use for decision making)

 

 

 

                                         (This shape is use for off page connector)

{an off-page connector means one part of the flowchart is present at page 1 and another part is at page 2.}

           

 

 

 

                                       (Ovel shape is use for on page connector)

                                {an on-page connecter is used to replace long flow lines}.

 

 

 

 


Example of flowchart:

 

Flowchart for add two numbers. 



 

 



 

.





 
















Post a Comment

Previous Post Next Post