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

 

jebbert@volusia.k12.fl.us > evenProduct
prev  |  next  |  chance

Write a method that accepts a positive even integer parameter, num, then returns the product of all the positive even integers less than or equal to num (as a long). For example, evenProduct(8) returns 384 because 2*4*6*8=384. This method can be done recursively, but you are NOT required to solve it that way.


evenProduct(2) → 2
evenProduct(4) → 8
evenProduct(6) → 48

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

public long evenProduct(int num) { }

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: 330

Copyright Nick Parlante 2017 - privacy