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

 

dsawyer@methacton.org intro_p4_level_3 > getRighty
prev  |  next  |  chance

Given two positive integers, n1 and n2, in ascending order, return the sum of the right-most digits of all the numbers between n1 and n2 (inclusive). For example, if n1 = 37 and n2 = 39, the method should return 24 because the right most digits of the numbers between 37 and 39 are 7, 8,and 9.


getRighty(37, 39) → 24
getRighty(1, 3) → 6
getRighty(61, 63) → 6

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

public int getRighty( int n1, int n2 ){ }

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: 299 Post-solution available

Copyright Nick Parlante 2017 - privacy