Find the average of n numbers
Problem Given a set of n numbers (data type long). Write an algorithm to get the average.
Constraints
It should work if one of the contributing number is the maximum possible number of type long. Casting it to other data types is not allowed. Solution We can’t use addition for getting the average. If we do, first constraint might not get incorporated as we may overflow. .
[Read More]