id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

norm.krumpe@muohio.edu 174problems > numCows
prev  |  next  |  chance

A farm consists entirely of cows and chickens. Given the number of animal heads and animal legs on the farm, return the number of cows on the farm.


numCows(3, 6) → 0
numCows(5, 20) → 5
numCows(2, 6) → 1

...Save, Compile, Run (ctrl-enter)

int numCows(int heads, int legs) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy