A lot of programming work involves doing something a certain number of times. There are usually multple ways of doing this, but I suggest you use a loop with a built in counter if your language supports it.
In this exercise you need to write a program adds up all numbers between 1 and 66. The final result should be printed to the screen.
Difficulty level: Very easy.
Estimated time: 5-10 minutes
If you’re not sure how to do this, take a look at the for loop. If you still need help, take alook at my c# solution.
If you don’t know an easy solution to this problem and are using any c-style language (c#, java, php, c, c++ etc). Take a look at the for loop.
Here’s a quick example in C#, but it will look similar in many other languages.
int result = 0;
for (int i = 1; i <= 66; i++)
result += i;