Question

Convert Binary to a decimal using recursion and vice versa.

				
					Press 1 to convert binary to decimal
Press 2 to convert decimal to binary
1
ENTER BINARY NUMBER:1111101
THE DECIMAL VALUE OF BINARY 1111101 IS 125



Press 1 to convert Binary to Decimal
Press 2 to convert Decimal to Binary
Enter your choice:2
Enter the Decimal number:125
The binary value of 125 is 1111101

Press 1 to convert Binary to Decimal
Press 2 to convert Decimal to Binary
Enter your choice:2
Enter the Decimal number:-125
The binary value of -125 is -1111101


Press 1 to convert Binary to Decimal
Press 2 to convert Decimal to Binary
Enter your choice:1
Enter the Binary number:-1111101
The decimal value of -1111101 is -125


Press 1 to convert Binary to Decimal
Press 2 to convert Decimal to Binary
Enter your choice:1
Enter the Binary number:120101
Invalid Binary number
				
			

Share code with your friends

Share on whatsapp
Share on facebook
Share on twitter
Share on telegram

Code

Coding Store