add using bit manupulation

Solutions on MaxInterview for add using bit manupulation by the best coders in the world

showing results for - "add using bit manupulation"
Samuel
14 Sep 2018
1#include <stdio.h>
2void sum(int i, int j)
3{
4        printf("The sum of the number is : ");
5        while(j != 0)
6        {
7                int carry;
8                carry = i & j;
9                i = i^j;
10                j = carry << 1;
11        }
12        printf("%d", i);
13}
14void main()
15{
16        int i,j;
17        printf("Enter the numbers : ");
18        scanf("%d %d", &i, &j);
19        sum(i, j);
20        printf("\n");
21}
similar questions
queries leading to this page
add using bit manupulation