text: Decimal to Binary using recursion and without using power operator | Recursive function to convert n to its binary equivalent ; Base case ; Recursive call ; Driver code
code: function decimalToBinary ( n ) { if ( n == 0 ) { document . write ( " " ) ; return ; } decimalToBinary ( parseInt ( n / 2 ) ) ; document . write ( n % 2 ) ; } var n = 13 ; decimalToBinary ( n ) ;