Question: C++ hw program help Need help with this problem below: Write a program which reads in two integers 1

C++ hw program help

Need help with this problem below:

Write a program which reads in two integers 1 <= n <= 10,000 and 1 <= s <= n and returns the sum of the last s elements in the sequence from 1 to n (inclusive). For example, if the input is 20 4 the output would be 74.

Need help wrapping my head around this one! Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!