about | help | code help+videos | done | prefs |
Write a method that performs a bit-wise logic-shift-left on the binary representation of the non-negative integer input parameter. Return the integer representing the resulting binary number. For example, if the input parameter is 23, the binary representation for that is 10111. After logic-shifting-left, you would have 10110 (each binary digit being shifted left one position). The right-most digit will always be a zero after performing the logic-shift left. So, with the input parameter value being 23, which is 10111 in binary, the logic-shift-left would produce 101110, which is 46 in decimal, so you would return 46. Look at the test data for additional examples. You may assume that the input parameter is small enough not to produce an integer "overflow". You may NOT use ANY strings or string methods. may25_2018_APSL_bitShiftLeft(172) → 344 may25_2018_APSL_bitShiftLeft(81427) → 162854 may25_2018_APSL_bitShiftLeft(1944) → 3888 ...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