about | help | code help+videos | done | prefs |
Write a method that returns an integer that has all the digits of 'num' but in reverse order. Note that trailing zeros become leading zeros, but those leading zeros do not appear in the value you return since 0003 is just 3 (for example). You are NOT allowed to use ANY arrays, ArrayLists, or anything similar to that. You are NOT allowed to use Strings. You are NOT allowed to use the Math library. You are NOT allowed to use more than four local variables. You MAY write a recursive solution, but that is not required. Look at the test data for examples. test2021_12_15_HL_reverseNum(1246) → 6421 test2021_12_15_HL_reverseNum(700000) → 7 test2021_12_15_HL_reverseNum(81005) → 50018 ...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: 290
Copyright Nick Parlante 2017 - privacy