154k views
2 votes
Write a procedure ConvertToBinary that takes an input as a number from 0 to 16 (including 0 but not 16) and converts it to a binary number. The binary number should be returned as a list.

User Scunliffe
by
8.8k points

1 Answer

5 votes

Answer:function ConvertToBinary(n) {

console.log(n.toString(2).split(''));

}

ConvertToBinary(13);

Step-by-step explanation:

User Ricardo Markiewicz
by
9.2k points