Convert numbers into binary representation and add them without carry | Java program to add two binary number without carry ; Function returns sum of both the binary number without carry ; XOR of N and M ; Driver code
import java . util . * ; class GFG { static int NoCarrySum ( int N , int M ) { return N ^ M ; } public static void main ( String [ ] args ) { int N = 37 ; int M = 12 ; System . out . print ( NoCarrySum ( N , M ) ) ; } }