Algorithm to find greatest of N numbers

1. Start.

2. Read N numbers.

3. Assign first number to variable max.

4. Check if second number > max, then max=second number.
  Check if third number > max, then max=third number.
  .........
  .........
  Check if Nth number>max, then max=Nth number.

5.End.

No comments:

Post a Comment