Question: Java Programming Challenge Description: Write a program that, given two binary numbers represented as strings, prints their sum in binary. The binary strings are comma
Java Programming Challenge Description:
Write a program that, given two binary numbers represented as strings, prints their sum in binary. The binary strings are comma separated, two per line. The final answer should not have any leading zeroes. In case the answer is zero, just print one zero i.e. 0
Input:
Your program should read lines from standard input. Each line contains two binary strings, separated by a comma and no spaces.
Output:
For each pair of binary numbers print to standard output their binary sum, one per line.
Test 1
Test Input
Download Test Input
110011,1010
Expected Output
Download Test Output
111101
Test 2
Test Input
Download Test Input
11010,00101001
Expected Output
Download Test Output
1000011
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
