Algorithm

It is step by step procedure to solve any problem.

Characteristics of an algorithm:

  1. All the steps of an algorithm must be executed in sequence to obtain the output.
  2. An algorithm must terminate after a finite number of steps.
  3. It may take zero or more inputs.
  4. It must give at least one output.

Algo: Find area and perimeter of square

  1. Start/Begin
  2. Enter side of square
  3. perimeter = 4*side
  4. area = side*side
  5. Print perimeter
  6. Print area
  7. Stop/End

Algo- Find area and perimeter of rectangle

  1. Start/Begin
  2. Enterlength and breadth as l & b of rectangle
  3. perimeter = 2*(l+b)
  4. area = l*b
  5. Print perimeter
  6. Print area
  7. Stop/End

Algo- Find total & percentage of a student based on marks in five subjects

  1. Start/Begin
  2. Enter marks in five subjects as m1,m2, m3, m4, m5
  3. Total = m1+m2+m3+m4+m5
  4. Percentage = Total/5
  5. Print total
  6. Print percentage
  7. Stop/Exit
error: You can only copy the programs code and output from this website. You are not allowed to copy anything else.