C++ Write a program that outputs the difference (absolute value) between any successive (adjacent) pair of numbers in an

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

C++ Write a program that outputs the difference (absolute value) between any successive (adjacent) pair of numbers in an

Post by answerhappygod »

C Write A Program That Outputs The Difference Absolute Value Between Any Successive Adjacent Pair Of Numbers In An 1
C Write A Program That Outputs The Difference Absolute Value Between Any Successive Adjacent Pair Of Numbers In An 1 (68.08 KiB) Viewed 19 times
C++ Write a program that outputs the difference (absolute value) between any successive (adjacent) pair of numbers in an integer list. Such a list might represent daily stock market prices or daily temperatures, so the difference is the biggest single-day change. Part I: First let the user input an integer that represents the list size. Once that is done allow the user to enter all the elements of the list without a prompt since the input has to be done inside a loop. Use the format below: (80 Points) Enter the list size: [……] Ex:ample: If the input is: 6 then the user will have to input 6 integers such as: 60 63 53 58 62 63. For this example the output would be: Biggest difference: 10 Part II: Update the code to also output which pair of numbers in the list produce the biggest difference. Using the example from part I the output would be number 2 and number 3. Use the format below: (20 Points) Biggest pair: 2 3
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply