John had mangoes. He ate 5 and shared the remaining among her 6 friends. He however found that he needed 2 more mangoes if each of the friends was to get 4 mangoes. How many mangoes had he at the beginning?

he had six friends, two each would have been 24 mangoes, however, he is short of 24 by 2, so he had left 22, and he then must have started with 27

To find out how many mangoes John had at the beginning, we can work backwards using the information given.

Let's suppose John had "x" mangoes initially.

He ate 5 mangoes, so he has "x - 5" mangoes left.

He shared the remaining mangoes among 6 friends, so each friend received "(x - 5) / 6" mangoes.

We know that if each friend was to get 4 mangoes, John needed 2 more mangoes. So, we can set up the following equation:

[(x - 5) / 6] + 2 = 4

Now, we can solve the equation to find the value of "x".

Multiply both sides of the equation by 6 to eliminate the denominator:

x - 5 + 12 = 24

Combine like terms:

x + 7 = 24

Subtract 7 from both sides:

x = 17

Therefore, John had 17 mangoes at the beginning.