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



Comments

Popular posts from this blog

difference between structure and union in C Language

Difference between Linear search and Binary Search in c language

Difference between static and dynamic websites