Given two numbers, and the task is to find their addition using the minus (-) operator.
As we have discusses in C/C++ arithmetic operators that plus (+) operator adds the numbers and minus (-) operator subtracts the numbers. But adding two numbers using minus (-) operator can also be done – It's a simple mathematical trick.
As we know that, minus and minus becomes plus. Thus, to add two numbers – we can subtract the negative of the second number from the first number.
first_number - (-second_number)
x = 10
y = 20
result = x - (-y)
result = 30