You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
498 B
C++
27 lines
498 B
C++
#include<iostream>
|
|
#include<conio.h>
|
|
#include<stdlib.h>
|
|
|
|
using namespace std;
|
|
int add(int x, int y)
|
|
{
|
|
int carry;
|
|
while (y != 0)
|
|
{
|
|
carry = x & y;
|
|
x = x ^ y;
|
|
y = carry << 1;
|
|
}
|
|
return x;
|
|
}
|
|
int main(int argc, char **argv)
|
|
{
|
|
cout << "Enter the numbers to be added:";
|
|
int x, y;
|
|
cin >> x >> y;
|
|
cout << "The Summation is: " << add(x, y);
|
|
}
|
|
|
|
/*
|
|
Enter the numbers to be added:23 24
|
|
The Summation is: 47
|