HP Forums

Full Version: quick mini-challenge for 12c
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

All right, write the shortest possible program for the 12c that does this: You input the sum of 2 numbers, the difference of the same 2 numbers, and the program calculates and displays the 2 numbers.

01- STO 0
02- +
03- 2
04- /
05- ENTER
06- ENTER
07- RCL 0
08- -

Too many steps?

Gerson, your program displays the smaller of the two numbers, but not the larger (if I entered it correctly).

Sorry, I forgot to mention the other number is in register Y.

Yes, I saw that after I replied. I've got a 7 line program that pauses after the first number then displays the second.

Something like this?

01 -
02 LSTx
03 x<>y
04 2
05 /
06 PSE
07 +

Actually, more like your first one, except a little different:

01 STO 1
02 -
03 2
04 /
05 PSE
06 RCL 1
07 +

But yours works too. It's always great to see another mind at work!

I'm glad I didn't submit my first try at your mini-challenge. A very long 9-step program :-)

Regards,

Gerson.

Gerson, don't feel bad! My first try was 14 steps, but I knew it could be improved. My goal was to get to 8 or fewer steps, since the first 8 steps are "free" (that is, you don't lose any registers). Being a minimalist, I am intrigued by fitting a program in 8 steps on the 12c, if possible.

Thanks for your example.