document.write( "Question 698414: there are 13 animals in the barn.some are chicken some are pigs. there are 40 legs in all. how many of each animal are there? \n" ); document.write( "
Algebra.Com's Answer #430639 by htmentor(1343)\"\" \"About 
You can put this solution on YOUR website!
Let c = the number of chickens
\n" ); document.write( "Let p = the number of pigs
\n" ); document.write( "The total number of animals is 13:
\n" ); document.write( "c + p = 13 -> p = 13 - c
\n" ); document.write( "There are 40 legs in all:
\n" ); document.write( "2c + 4p = 40
\n" ); document.write( "2c + 4(13-c) = 40
\n" ); document.write( "Solve for c:
\n" ); document.write( "2c + 52 - 4c = 40
\n" ); document.write( "2c = 12
\n" ); document.write( "c = 6
\n" ); document.write( "So there are 6 chickens and 7 pigs
\n" ); document.write( "
\n" );