Skip to main content

Section 13.6 Practice: Compound Assignment Operators

Check Your Understanding Check Your Understanding

1.

Please complete the following program by creating a loop that adds up the numbers from n to 2n (have the user enter the number n). Save the result of this addition in the variable sum (which has already been declared) and print it out. Be sure to declare any other additional variables you might need for your loop.

admin.....open in new window

When your program performs correctly you’ll be given a keyword to enter in Canvas.