Sum of Even Numbers to 20
easyQuestion 200Write a program that adds up the even numbers 2, 4, 6, and so on up to and including 20, then prints the total. Keep a running sum and use a loop whose counter jumps by two each time so it only ever lands on even values. Print the final total once the loop ends. No input is required.
Expected output
110= newline. The output ends with a newline, so print one after the last line.
Hints3 available
Sign in to use hintsTopics
Loops
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.