A dairy farm's cattle consists of 75% cows and 25% buffaloes.
Exactly 80% of all these animals are producing milk.
There are 76 milkproducing cows in the farm.
The above data defines uniquely the total number of animals in the farm.
What is it?
This is an old problem from Hindu Math. sources.
For cows = 75 To 201 Step 3
buffaloes = cows / 3
tot = cows + buffaloes
producing = tot * 4 / 5
If producing = Int(producing) And producing >= 76 Then
Text1.Text = Text1.Text & cows & Str(buffaloes) & Str(tot) & Str(producing) & Str(producing  76) & crlf
End If
Next
cows bf tot producers
tot buf
75 25 100 80 4
90 30 120 96 20
105 35 140 112 36
120 40 160 128 52
135 45 180 144 68
150 50 200 160 84
165 55 220 176 100
180 60 240 192 116
195 65 260 208 132
Beyond 140 animals (the third line), there are more producing buffaloes than there are buffaloes, and the first line is not valid as there are fewer than 76 cows (the program started at 75 just to set the divisibility by 3).
So there are 90 cows and 30 buffaloes for a total of 120 animals, excluding any goats, etc. that might also be on the farm.

Posted by Charlie
on 20150107 10:30:39 