Stack Overflow for Teams is moving to its own domain! When the migration is complete, you will access your Teams at stackoverflowteams.com, and they will no longer appear in the left sidebar on stackoverflow.com.
Check your email for updates.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Once I fixed a few compile errors, the code works fine except for not handling validating various input errors. As for being excessively long, not really. There are 4 possible cases, which you handle....
The toupper() part is working fine, but based on what you're trying to do, you have two issues and a misconception.
Issue 1: You are storing the result of the subtraction in an int called keyvalue, ...