Algorithm in C++ Programming Language - How to Express an Algorithm

 


Algorithm:

  • An algorithm is a step by step procedure to solve a problem.
  • Systematic logical approach which is a well-defined, step-by-step procedure that allows a computer to solve a problem.
  • A procedure is a finite sequence of instructions, where each is carried out in a finite amount of time.
  • Every problem can be solved with the help of an algorithm.

Algorithm in C++ Programming Language - How to Express an Algorithm


For Example:
  • when the user wants to login to a Facebook account, first he has to go to Facebook.com. Then he has to give the correct username and password. Then he has to click the login button. If the username and password are correct, the user can enter his account.
  • Likewise, every problem has a sequence of steps to solve it. This is also an algorithm because it provides a correct sequence of steps to solve the problem.

Example 1:

Example of an algorithm

Example 2:

Example of an algorithm

How to Express an Algorithm:

Algorithms can be expressed in many kinds of notation, including:
  • Natural language
  • Pseudo Code
  • Flowcharts
  • Programming Language


Post a Comment

0 Comments