0

How to make the addition to a binary formula ?

example : we have 01101001 + 01001110 how can we do the addition of this formula ?

4th Nov 2016, 12:44 PM
Amine Karimi
Amine Karimi - avatar
1 Réponse
+ 4
Interesting querey.. following is an example which converts the decimal number to binary.YOu can perfrom addition after convertion. Then you need to convert back to decimal.. Public class ConvertIntToBinaryExample { public static void main(String[] args) { int i = 56; String strBinaryNumber = Integer.toBinaryString(i); System.out.println("Convert decimal number to binary number example"); System.out.println("Binary value of " + i + " is " + strBinaryNumber); }
4th Nov 2016, 1:04 PM
Sandeep Balachandran
Sandeep Balachandran - avatar