code.cpp 224 B

123456
  1. /* You've got chickens (2 legs), cows (4 legs) and pigs (4 legs) on your farm.
  2. * Return the total number of legs on your farm.
  3. */
  4. int animals(int chickens, int cows, int pigs) {
  5. return (chickens*2)+(cows*4)+(pigs*4);
  6. }