Subtract Without Subtract
Problem Description​
Create a function that subtracts one positive integer from another without using the -
operator.
Input​
- Two positive integers:
subtract
: The integer to subtract.from
: The integer from which to subtract.
Output​
- A single integer representing the result of the subtraction.
Constraints​
- Both input integers will be positive.
Example​
Input:
subtract: 5, from: 9Output:
4Explanation:
The result of subtracting 5 from 9 is 4.
Input:
subtract: 10, from: 30Output:
20Explanation:
The result of subtracting 10 from 30 is 20.