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

 

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

Write a method that returns the sum of the odd digits of the input parameter 'num'. For example, 5821 has four digits, but only 5 and 1 are odd digits. The sum of those odd digits is 6, so if 'num' was 5821 you would return 6. Look at the test data for additional examples. No use of strings is allowed for this problem.


nov21_2019_P1SLHL_sumOddDigits(325) → 8
nov21_2019_P1SLHL_sumOddDigits(3428) → 3
nov21_2019_P1SLHL_sumOddDigits(864002) → 0

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

public int nov21_2019_P1SLHL_sumOddDigits(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: 290

Copyright Nick Parlante 2017 - privacy