just a quick question , your code does add up bits to numbers which are higher than 2 which is binary’s limit ,for instance suppose n1 = 1111 and n2 is the same , then your code will show the result of 1234321 , though its not a valid binary number , How should we make the result be in binary ? thanks
Share
In Java you can do the following to get output in binary