Adding Two Values

Difficulty: ★ ☆ ☆ ☆

Adding values is a basic programming concept: 4 + 5 = 9 But where do the values come from? They can be literals, variables, expressions, or values collected from the user.

Your task for this month’s Exercise is to add two values. These values can be fetched from standard input. They could also be read from the command line. The point is that the values are user-supplied. Obtain the values, add them together, then output the result.

Here’s a sample run from one of my solutions:

Enter two values: 5 4
5 + 4 = 9

You need only code only solution, and you can try to obfuscate it or figure out a complex way beyond what may seem obvious.

Click here to view my solutions.

Leave a Reply