Convert numbers into binary representation and add them without carry | C ++ 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
#include <bits/stdc++.h> NEW_LINE using namespace std ; int NoCarrySum ( int N , int M ) { return N ^ M ; } int main ( ) { int N = 37 ; int M = 12 ; cout << NoCarrySum ( N , M ) ; return 0 ; }