Given 2 integer numbers we can calculate their average like this:
which isn’t safe since (a+b) can cause overflow (Side Note: can someone tell me the correct term for this case maybe memory overflow?)
So we write:
can the same trick be implemented over
n numbers and how?
Source: Windows Questions C++