Count Number of animals in a zoo from given number of head and legs | Function that calculates Rabbits ; Driver code
< ? php function countRabbits ( $ Heads , $ Legs ) { $ count = 0 ; $ count = ( $ Legs ) - 2 * ( $ Heads ) ; $ count = ( int ) $ count / 2 ; return $ count ; } $ Heads = 100 ; $ Legs = 300 ; $ Rabbits = countRabbits ( $ Heads , $ Legs ) ; echo " Rabbits = " ▁ , ▁ $ Rabbits ▁ , ▁ " " ; STRNEWLINE echo ▁ " Pigeons = " $ Rabbits , " STRNEWLINE " ; ? >