Algorithm

                   An algorithm is procedure consisting of a finite set of unambiguous rules (instructions) which specify a finite sequence of operations that provides the solution to a problem, or to a specific class of problems for any allowable set of input quantities (if there are inputs). In other word, an algorithm is a step-by-step procedure to solve a given problem


                 An algorithm is a sequence of steps required to solve a problem. It ia a list of well-defined instructions to solve a problem.

  1.  An algorithm ends after a fixed number of steps.
  2. Each step in an algorithm clearly specifies the actions to be performed.
  3. The steps in an algorithm specifies basic operations. This operations can be include calculations input/output operations and comparisons
  4. An algorithm accepts the input data in a defined format, before it can be processed
  5. An algorithm generates one or more outputs after the input is processed. The resultant information termed as output can be displayed or stored for a future reference.

Example:-1

           An algorithm, when you approach a traffic signal while driving a vehicle.

Step 1: start the algorithm

Step 2: Approach traffic light

Step 3: if the light is red, stop:

Step 4: if the light is yellow, slow down and then, stop

Step 5: Otherwise, the light is green , continue driving step 

6: stop

Comments

Popular posts from this blog

To accept two numbers and display their sum, product, difference, division.

To accept marks of five subject and display pass or fail ( if pass display Percentage too).