title: Decimal Binary Conversion Without Using Arithmetic Operators
signature: function decimalBinaryConversionWithoutUsingArithmeticOperators($n) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($n, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        35, 
        "100011"));
      
      printf("TEST-1...%s\n",driver(
        17, 
        "10001"));
      
      printf("TEST-2...%s\n",driver(
        8, 
        "1000"));
      
      printf("TEST-3...%s\n",driver(
        99, 
        "1100011"));
      
      printf("TEST-4...%s\n",driver(
        57, 
        "111001"));
      
      printf("TEST-5...%s\n",driver(
        39, 
        "100111"));
      
      printf("TEST-6...%s\n",driver(
        99, 
        "1100011"));
      
      printf("TEST-7...%s\n",driver(
        14, 
        "1110"));
      
      printf("TEST-8...%s\n",driver(
        22, 
        "10110"));
      
      printf("TEST-9...%s\n",driver(
        7, 
        "111"));
      
  }
  
  main();
  ?>
source_py: def decimal_binary_conversion_without_using_arithmetic_operators(n):
      if (n == 0):
          return '0'
      bin = ''
      while (n > 0):
          if ((n & 1) == 0):
              bin = ('0' + bin)
          else:
              bin = ('1' + bin)
          n = (n >> 1)
      return bin
source_cpp: string decimal_binary_conversion_without_using_arithmetic_operators(int n) {
    if ( n == 0 ) return "0";
    string bin = "";
    while ( n > 0 ) {
      bin = ( ( n & 1 ) == 0 ? '0' : '1' ) + bin;
      n >>= 1;
    }
    return bin;
  }