Write a program in C to add two numbers without using addition operators.

/* Add two numbers without using addition operator */
#include 
int main() 

int a, b;
int sum; 
printf("Enter any two integers: "); 
scanf("%d%d", &a, &b); 
 //sum = a - (-b); 
sum = a - ~b -1; 
printf("Sum of two integers: %d", sum); 
 getch(); 
return 0; 
}

0 comments:

Feel free to contact the admin for any suggestions and help.