Design an algorithm to find the average

November 06, 2014 0 Comments

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



Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google

0 comments: