+ 1

Write a program in C to add two numbers without using + operator?

10th Sep 2017, 5:53 PM
Amith R Patil
5 Respostas
+ 4
Can we do it in C++? int a, b; std::vector<int> v = {a,b}; int sum = std::accumulate(v.begin(), v.end(), 0);
10th Sep 2017, 6:02 PM
Karl T.
Karl T. - avatar
10th Sep 2017, 6:44 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
https://code.sololearn.com/c1s6Mlfra02c/?ref=app
10th Sep 2017, 5:55 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 1
I can do -(-a-b) instead of a+b but I do not think this is what you wanted ^^
10th Sep 2017, 5:58 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
0
try reducing the size
10th Sep 2017, 5:57 PM
Amith R Patil