I want to make a program to store data of rainfalls for 3 years. Initialized an array of double rainfalls...Made one function to find average rainfall values of the 2D array...Found the average rainfall of the total of 3 years but how do i find the average of per year? Like how do i find the average of 1st year, 2nd year and 3rd year individually??Here's the code:
Thank you for using the code button, but you didn't quite get it right. Please see the link on the left. If I remember, I'll correct that for you and it will look much better
Your question would fit better in another forum, so I shall move you there.
You calculate the arithmetical mean, which is probably the average you want, by adding all the numbers and dividing by how many numbers there are (12 or 36). You seem to be doing that already; please tell us whether your program doesn't work.
Why are you asking for keyboard input when you already have those figures in the array?