about | help | code help+videos | done | prefs |
Write a method that returns the numeric value of the last two digits of input parameter 'num'. The 'last two' digits means the digits in the ten's place and the one's place. As a precondition you may assume that 'num' is positive. Note that 'num' could contain only a single digit, in which case you return that single digit. Also note that the last two digits could both be zeros, in which case you return the value of zero because '00' has a value of zero. Look at the test data for examples. test2022_10_13_APP1SLHL_lastTwoDigits(352000) → 0 test2022_10_13_APP1SLHL_lastTwoDigits(21896) → 96 test2022_10_13_APP1SLHL_lastTwoDigits(412) → 12 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 220
Copyright Nick Parlante 2017 - privacy