0

Is their any way to add two numbers without using '+' operator or operator overloading?

Is this possible by embedding assembly code into our code?

9th Nov 2017, 7:17 PM
Alfaf Shaikh
Alfaf Shaikh - avatar
1 ответ
+ 6
You can use bitwise addition: int add(int x, int y) { while(y != 0) { int c = (x & y); x = x ^ y; y = c << 1; } return x; }
9th Nov 2017, 7:49 PM
ChaoticDawg
ChaoticDawg - avatar
Актуальное сегодня
.
1 Votes
What?
0 Votes
HTML
0 Votes
Web
0 Votes
Quiz duel
0 Votes
FRC Coding?
1 Votes
AI
2 Votes
help
0 Votes
APIs
1 Votes