can some body tell , how to write function which
calculates average of all the elements of the 2D array
can some body tell , how to write function which
calculates average of all the elements of the 2D array
Sum the elements and divide by the number of elements. (Post your attempt -- and please use [code][/code] tags.)
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Walk through all the elements, summing them up. Then divide that total by the number of elements in the array.
EDIT: Beaten to the punch *shakes fist at Dave*
If you understand what you're doing, you're not learning anything.