ServiceNow interview question

Implement the code for binary representation of a given number