Diffrence between Algorithm and Pseudocode

 Difference between Algorithm and   Pseudocode:

Both Algorithm and Pseudocode are use in programming to create a program in very effective manner. with the help of pseudocode and algorithm programmer can easily understand about the problem. But there are lot of differences between pseudocode and algorithm:


Diffrence between Algorithm and Pseudocode


Difference between pseudocode and algorithm:

  • An algorithm is a well-defined sequence of steps that provides a solution for a given problem, while a pseudocode is one of the methods that can be used to represent an algorithm.
  • Algorithm can be written in natural language ,but Pseudocode is written in a format that is closely related to high level programming language structures.
  • algorithms is  a systematically written code.pseudocodes  are simpler ways of writing codes.
  • algorithms can be considered pseudocode.but pseudocode can’t be considered algorithm.
  • in algorithm  plain text is used.but in pseudocode Control structure such as while ,do-while,if and so on can be used.
  • an algorithm is easy to debug.but an pseudocode is difficult to debug as compare to algorithm.
  • While making an algorithm there are no rules to be follow.but an pseudocode has certain rules to follow while constructing it.
  • algorithm's construction is tough.but As compare to algorithm the construction of pseudocode is easy.
  • an algorithm can’t be easily understandable by the programmer. But pseudocode can be easily understandable by the programmer.
  • example of algorithm:

  • 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.


  • example of pseudocode:

  • Pseudocode to add two numbers in c programming. 

    BEGIN

    NUMBER s1,s2,sum

    OUTPUT("Input number 1:")

    INPUT s1

    OUTPUT("Input number 2:")

    INPUT s2

    sum=s1+s2

    OUTPUT sum

    END

    Post a Comment

    Previous Post Next Post