It sounds pedantic, but it will save you trouble one day.
Instead of the magic value of 12 everywhere make it a const variable, and use that:
1 2
constexprunsignedint Size =12; // could use const instead of constexpr
double rainfall[Size];
but then be sure to do this:
avg = total / static_cast<double>(Size);
I made Size an unsignedint because it shouldn't be negative, but it is technically better to make it std::size_t, as this is what is used for the size of containers in C++.