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

 

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

The digit product of a non-negative integer is the product of all the digits on that integer. For example, the digit product of 516 is 30 since 5*1*6=30. The recursive digit product of a number finds the digit product of a number, then finds the digit product of that result and continues until a single digit number is obtained. For example, the recursive digit product of 516 is 0 since the digit product of 516 is 30, and the digit product of 30 is 0. As another example, the recursive digit product of 42782 is 8. Here is the process: Digit product of 42782 is 896. Digit product of 896 is 432. Digit product of 432 is 24. Digit product of 24 is 8. Write a method that returns the recursive digit product of the non-negative integer parameter 'num'. Look at the test data for further examples.


quiz2023_02_28_SLHL_digitProductRecursive(88) → 8
quiz2023_02_28_SLHL_digitProductRecursive(12489) → 0
quiz2023_02_28_SLHL_digitProductRecursive(9234) → 2

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

public int quiz2023_02_28_SLHL_digitProductRecursive(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: 280

Copyright Nick Parlante 2017 - privacy