Here's a Perl script that will answer the problem for any number of heads and feet. sub how_many { print "Number of heads: "; chomp($h = ); print "Number of feet: ";chomp($f = ); $p = $h; $c = 0; while (($p*4 + $c*2) != $f) { $p--; $c++; } } &how_many; print "There are $p pigs and $c chickens.\n"; print "They have $h heads and $f feet.\n"; Number of heads: 27 Number of feet: 78 There are 12 pigs and 15 chickens. They have 27 heads and 78 feet.
35 pigs, 65 chickens
Let the number of chickens be x and the number of pigs be y. Each chicken has 1 head and 2 feet, while each pig has 1 head and 4 feet. We can then write the equations x + y = 48 (counting heads) and 2x + 4y = 124 (counting feet). Solving these equations simultaneously gives x = 24 and y = 24, so there were 24 chickens and 24 pigs.
THERE ARE @! chickens and !$ pigs... u have to figure out the numbers.... look at the numbers at ur keyboard. look ontop of numbers... any1 here play dungeon fighters online??? A A AA AA
Since PIgs don't fly yet, we will say they have no wings and we say chickens have 2 legs. Let C be the number of chickens and P be the number of pigs. Also, let's assume each chicken has two wings. 4P+2C=24 2C=12 so C=6 4P+12=24 4P=12 so P=3 6 chickens and 3 pigs. This answer must be changed when pigs fly!
48 chickens 1 pig
14 pigs 8 chicken's Since there are 22 heads, let the number of pigs be x and the number of chickens be 22 - x. Since pigs have 4 legs and chickens have 2 legs, and there are 72 legs in all, we have 4x + 2(22 - x) = 72 4x + 44 - 2x = 72 2x + 44 = 72 2x + 44 - 44 = 72 - 44 2x = 28 2x/2 = 28/2 x = 14 (the number of pigs) 22 - x = 22 - 14 = 8 (the number of chickens)
There are 139 chickens and 30 pigs. Let c = number of chickens and p = number of pigs Each has 1 head, therefore c + p = 169 Each chicken has 2 feet and each pig has 4 feet, therefore 2c + 4p = 398 => c + 2p = 199 Subtracting the first from the second gives: c + 2p - c - p = 199 - 169 => p = 30 Substitute in the first c + 30 = 169 c = 139
8 pigs & 9 ducks
There are 5 chickens and 6 pigs in the barn. Each chicken has 2 legs and each pig has 4 legs.
Let c represent the number of chickens and p represent the number of pigs.Since chickens and pigs have one head each, 70 heads = c + p.Since chickens have 2 legs and pigs have 4 legs, 200 legs = 2c + 4p.Subtracting twice the first equation (140 = 2c + 2p) from the second, we get60 = 2porp = 30 pigsRewriting the first equation as c = 70 - p, we get c = 40 chickens.
14 chickens and 11 pigs.
chickens chickens