Codington
0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Add a Running Total

A variable declared before a loop can remember work from every repetition. This is called an accumulator.

Your task

Complete the missing line so total becomes 1 + 2 + 3 + 4. Keep the supplied loop and final output.