int sum(int a, int b){ int carry = 1; int res = 0 ; while(carry != 0){ res = a^b; carry = (a&b)<<1; a = res; b = carry; } return res; }