➕ Add Any Numbers Without “+” Operator In C ➕
Bitwise operators can be used to perform the addition (+) operation as mentioned in below example 🔆
〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰
#c #cpp #operator
@ProgrammingTip
Bitwise operators can be used to perform the addition (+) operation as mentioned in below example 🔆
int Add(int x, int y)
{
if (y == 0)
return x;
else
return Add( x ^ y, (x & y) << 1);
}
〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰〰
#c #cpp #operator
@ProgrammingTip