Question: Write a program to compute the sum of the n first terms of the series 1 - 2 + 3 - 4 + ... +

Write a program to compute the sum of the n first terms of the series 1 - 2 + 3 - 4 + ... + 1999 - 2000 + .... The number number n is an input of the program. Write a program to compute the sum of the n first terms

Example #1 1 Enter the number of terms: 12 2 The sum of the 12 first terms is -6 Example #2 1 Enter the number of terms: 2000 2 The sum of the 2000 first terms is -1000

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!