-->

Thursday, November 6, 2014

Design an algorithm to find the average

Design an algorithm to find the average

Problem :  Design an algorithm to find the average of a subject marks of 'N' number of students.
Input: A list of marks and number of students.
Output: Returns the average marks calculated.

AVG_OF_MARKS(LIST,N)
[LIST is an array containing marks, N is the size of array]
SUM <-- 0
Repeat For I=1,2,3,.........N
SUM<-- SUM+LIST[I]
[END of For I]
AVG <-- SUM/N
Returns AVG
Exit



Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved