about | help | code help+videos | done | prefs |
Write a method that converts the input parameter 'num' to a binary number and returns that binary number as a string. For example, in binary 18 is represented as 10010, so if you pass in 18 the method should return "10010". This can be done iteratively with a single loop or can be done recursively with no loops! However, if you need more than one loop that is OK. Also, recursion is NOT required. Look at the test data for further examples. test2021_01_15_P1SLHL_toBinary(21847) → "101010101010111" test2021_01_15_P1SLHL_toBinary(129802) → "11111101100001010" test2021_01_15_P1SLHL_toBinary(11) → "1011" ...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