CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 3

3. Write a program which accept two numbers and print their sum.

For this assignment, I ran into one minor snag.  At first, I placed all of the variables and the addition formula at the top.  This created a problem because the addition formula should have been placed after the computer received the user input for x and y.  It was rather shocking at first to see such a crazy number by simply inputting 1 and 1.



Luckily, I was able to resolve this issue rather easily by simply moving the sum equation after the user input for x and y.  From there, it worked as expected.  Whew!


It is working correctly.  No more crazy numbers here.










Comments

Popular posts from this blog

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 9

CPPForSchool.com: Array - Single Dimension Set 1 Assignment 6

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 8