Interview Solution

Good code is its own best documentation. As you're about to add a comment, ask yourself, 'How can I improve the code so that this comment isn't needed?' Improve the code and then document it to make it even clearer. Steve McConnell

Binary Decimal

Language Java | Level Intermediate | Category Interview Problems | July 24, 2015 4:52 pm

Comments


Interview Problem

Convert from Binary to Decimal and decimal to Binary number.
Write program to convert Decimal to Binary using stack and convert the binary number to decimal
Example:-
Given binary 101
Return 5.0


Output

   					 
Decimal converted to binary number:5
After converting to Binary:[1, 0, 1]

Binary Number to be convert to Decimal:101
After converting to Decimal:5.0

				    

Comments



Please login to add comments.