I’ve a number Between 10 and 30, I need to present this number in 4 operation addition or subtraction but both should be present at least one time so always we need to use addition and subtraction at least one time.
Here is an example:
The number is 21 I need to generate: 5+6 , 8-5, 9-4, 1+1 (11+3+5+2)=21 (or any other combination equals to 21)
I need generate 4 operations for any number between 10 and 30
anyone could help me out?
If you have a sample in Java, C# or VB it works for me.
Maybe something like this, customize it to meet your needs: