Computer Science, asked by maimounadiarra892, 5 hours ago

Write a C++ program to prompt a user to enter two values for integers x and y, then display what the user inputs in a single line as shown:

You entered: 5 for x and 10 for y!

Answers

Answered by ItxAttitude
0

First, read the input from the user and store them in 2 variables (for example, x and y).

Second, you check if x - y is negative. If it’s negative, you put this in the expression -(x-y)/(x+y). If it's positive, just put in the expression (x-y)/(x+y).

Answered by devindersaroha43
1

Answer:

Explanation:

In this program, user is asked to enter two integers. These two integers are stored in variables firstNumber and secondNumber respectively. Then, the variables firstNumber and secondNumber are added using + operator and stored in sumOfTwoNumbers variable. Finally, sumOfTwoNumbers is displayed on the screen.

Similar questions