Wednesday, 9 April 2014

Write a c++ program to add two numbers without using addition operator.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#include<iostream.h>
#include<conio.h>
void main(){
clrscr();
int a,b;
int sum;
cout<<"Enter any two integers:\n ";
cout<<"Enter first integers= ";
cin>>a;
cout<<"Enter second integers= ";
cin>>b;
sum = a - (-b);
//sum = a - ~b -1;
cout<<"Sum of two integers:"<<sum;
getch();
}


OUTPUT

All Rights Reserved c++ programming