Question: Write a program that prompts the user to enter an integer (n) and a sum value (8). The program checks the value of n +

Write a program that prompts the user to enter an integer (n) and a sum value (8). The program checks the value of n + n), if it is less than or greater than the entered sum (s), the program finds the needed value to be added to or subtracted from (n + n) in order to reach the given sum (s) and displays it, otherwise it displays that n+ n-sum Sample Runi: Enter an integer: 5 Enter a sum: 25 You need to add 15 to reach the sum. Sample Run 2 : Enter an integer: 8 Enter a sum: 6 You need to subtract 10 to reach the sum. Sample Run 3 : Enter an integer: 7 Enter a sum: 14 7 +7 - 14
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
