Fast average of two numbers without division
Given two numbers, find floor of their average without using division. Input : x = 10, y = 12Output : 11Input : x = 10, y = 7Output : 8We take floor of sum.The idea is to use right shift operator, instead of doing (x + y)/2, we do (x + y) >> 1 C++ // C++ program to find average without using /